IteratorSequence, dead code?

2015-08-21 Thread William la Forge
I've been using Java class ItreratorSequence in package clojure.lang. But then I noticed that this class is not referenced anywhere. Is this dead code or otherwise not supported? I had been planning on subclassing this code. -- You received this message because you are subscribed to the

Re: IteratorSequence, dead code?

2015-08-21 Thread William la Forge
Oh! First, let me correct. I'm referring to IteratorSeq in clojure.lang. The constructor is package scoped, so I'll need to copy the code instead of subclassing. (Or convert it to Clojure.) So my question really is if the code is outdated? Seems to run fine for my limited tests so far. But I

[ANN] Release 0.34.0 of Counterclockwise

2015-08-21 Thread Laurent PETIT
Counterclockwise, the Eclipse Clojure development tool. Counterclockwise 0.34.0 has been released. Highlights: - Resource hyperlinks: you can Cmd+Clik (or F3) on string literals that represent resources, they will be open. Searches for files relative to the current file, or the classpath, or

Re: IteratorSequence, dead code?

2015-08-21 Thread William la Forge
Thanks! On Friday, August 21, 2015 at 7:54:04 AM UTC-4, Moe Aboulkheir wrote: William, https://clojuredocs.org/clojure.core/iterator-seq previously used it, but as of this commit: https://github.com/clojure/clojure/commit/c47e1bbcfa227723df28d1c9e0a6df2bcb0fecc1 uses

Re: IteratorSequence, dead code?

2015-08-21 Thread William la Forge
Deprecated is fine. It can not be sub-classed as it has package-scoped methods. Am rewriting it in Clojure, which is a great exercise for this raw newbie. Thanks! Only I was worried if it is out of date, which it is not looking like for now. On Friday, August 21, 2015 at 8:04:16 AM UTC-4,

Re: Why I'm getting NPE with zipper/next?

2015-08-21 Thread Moe Aboulkheir
Hussein, How are you constructing your zipper, before passing it to traverse? Note that clojure.zip doesn't work on arbitrary data structures without being given some information about how to descend into/construct nodes, etc. - i.e. z/next expects a zipper, and your data structure isn't a

Why I'm getting NPE with zipper/next?

2015-08-21 Thread Hussein B.
Hi, I have this structure: (def s [{n {id a} d 2 children [{n {id c} d 4 children []}]} {n {id b} d 3 children []}]) And I wrote a function with zippers to traverse it: (defn traverse [col] (loop [z col] (if (= (z/next z) z) z (if (z/branch? z) (recur (z/next z))

Re: Why I'm getting NPE with zipper/next?

2015-08-21 Thread Hussein B.
Hi, I changed println to z/node , this time I'm getting: NullPointerException clojure.zip/branch? (zip.clj:73) On Friday, August 21, 2015 at 5:56:10 PM UTC+2, Moe Aboulkheir wrote: Hussein, The println inside (recur) will return nil. Take care, Moe On Fri, Aug 21, 2015 at 4:35

Re: Why I'm getting NPE with zipper/next?

2015-08-21 Thread Moe Aboulkheir
Hussein, The println inside (recur) will return nil. Take care, Moe On Fri, Aug 21, 2015 at 4:35 PM, Hussein B. hubaghd...@gmail.com wrote: Hi, I have this structure: (def s [{n {id a} d 2 children [{n {id c} d 4 children []}]} {n {id b} d 3 children []}]) And I wrote a function with

Re: How can find something inside heavily nested data structure ?

2015-08-21 Thread Hussein B.
Yes, that does the job. Thanks for your help and time. On Thursday, August 20, 2015 at 12:21:47 AM UTC+2, Alan Forrester wrote: On 19 Aug 2015, at 18:08, Hussein B. hubag...@gmail.com javascript: wrote: Here is more concrete example (def s [{n {id a} d 2 children [{n {id c} d 4

Re: Why I'm getting NPE with zipper/next?

2015-08-21 Thread Colin Yates
I recall a while ago running into this. I ended up with the following: (defn stop? Returns true if there is no point continuing past the specified loc. loc may be null or (z/end?). This is only here because z/up returns nil rather than something (z/end? will work with). [loc] (or

Re: Why I'm getting NPE with zipper/next?

2015-08-21 Thread Hussein B.
Here is my zipper: (z/zipper #(contains? % children) #(get % children) (fn [_ c] c) s) On Friday, August 21, 2015 at 6:49:25 PM UTC+2, Moe Aboulkheir wrote: Hussein, How are you constructing your zipper, before passing it to traverse? Note that clojure.zip doesn't work on arbitrary data

Re: Why I'm getting NPE with zipper/next?

2015-08-21 Thread Moe Aboulkheir
Hussein, I don't get an NPE passing that to traverse, but nothing much interesting happens either. The top-level data structure (and the vectors within children) aren't associative, and so don't pass the branch? test (contains? % children). You could certainly extend the zipper to cover both

Re: IteratorSequence, dead code?

2015-08-21 Thread Moe Aboulkheir
William, https://clojuredocs.org/clojure.core/iterator-seq previously used it, but as of this commit: https://github.com/clojure/clojure/commit/c47e1bbcfa227723df28d1c9e0a6df2bcb0fecc1 uses RT/chunkIteratorSeq http://dev.clojure.org/jira/browse/CLJ-1669 : IteratorSeq will no longer be used but

Re: IteratorSequence, dead code?

2015-08-21 Thread Alex Miller
I would consider IteratorSeq to be deprecated and a candidate for removal, so subclass at your own risk. Alex -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Re: [ANN] New Clojure Book: Clojure Data Structures and Algorithms Cookbook

2015-08-21 Thread Colin Fleming
Hi Rafik, Congratulations, the book looks very interesting - lots of advanced topics there. It's nice to see more diverse books for Clojure, thanks! Cheers, Colin On 20 August 2015 at 13:21, Rafik NACCACHE rafik.nacca...@gmail.com wrote: Hi Guys, I am proud to let you know that my book

Re: Unable to write GPL software with clojure?

2015-08-21 Thread Fluid Dynamics
On Thursday, August 20, 2015 at 1:40:54 PM UTC-4, Atamert Ölçgen wrote: If it included clecs' source and the game's source it would be enough for me. I wouldn't want to dictate terms for other people's code. If another library the game depends on is also GPL, it's source should be included