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 Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
worry about using is as a starting point since the code is apparently 
unreferenced.

On Friday, August 21, 2015 at 6:37:48 AM UTC-4, William la Forge wrote:

 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 Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 the project. Also works if the resource
is an absolute filesystem path.
- Fix an issue with Alt+L L for launching arbitrary Leiningen commands

ChangeLog
=

http://doc.ccw-ide.org/ChangeLog.html#_changes_between_counterclockwise_0_33_0_and_0_34_0

Installation instructions
==

http://doc.ccw-ide.org/documentation.html#_install_counterclockwise

Cheers,

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 RT/chunkIteratorSeq 

 http://dev.clojure.org/jira/browse/CLJ-1669 : IteratorSeq will no 
 longer be used but is left in case of regressions for now. 

 Take care, 
 Moe 

 On Fri, Aug 21, 2015 at 12:02 PM, William la Forge lafo...@gmail.com 
 javascript: wrote: 
  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 
 worry 
  about using is as a starting point since the code is apparently 
  unreferenced. 
  
  
  On Friday, August 21, 2015 at 6:37:48 AM UTC-4, William la Forge wrote: 
  
  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 Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.com 
 javascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  Clojure group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/d/optout. 


-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, Alex Miller wrote:

 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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 zipper, but an input to a zipper.  Unless
you've written a zipper you omitted from your post, zipping over maps,
in particular, may not be as convenient as you're imagining.
https://clojuredocs.org/clojure.zip/zipper has helpful examples in it.

Take care,
Moe

On Fri, Aug 21, 2015 at 5:06 PM, Hussein B. hubaghd...@gmail.com wrote:
 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 PM, Hussein B. hubag...@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 zippers to traverse it:
 
   (defn traverse [col]
(loop [z col]
  (if (= (z/next z) z)
  z
  (if (z/branch? z)
(recur (z/next z))
(recur (- z println z/next))
 
 
  But I'm getting: NullPointerException   clojure.zip/next (zip.clj:236)
 
  Any ideas?
 
  Thanks for help.
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clo...@googlegroups.com
  Note that posts from new members are moderated - please be patient with
  your
  first post.
  To unsubscribe from this group, send email to
  clojure+u...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  ---
  You received this message because you are subscribed to the Google
  Groups
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send
  an
  email to clojure+u...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

 --
 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 members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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))
  (recur (- z println z/next))


But I'm getting: NullPointerException   clojure.zip/next (zip.clj:236)

Any ideas?

Thanks for help.

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 PM, Hussein B. hubag...@gmail.com 
 javascript: 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 zippers to traverse it: 
  
   (defn traverse [col] 
(loop [z col] 
  (if (= (z/next z) z) 
  z 
  (if (z/branch? z) 
(recur (z/next z)) 
(recur (- z println z/next)) 
  
  
  But I'm getting: NullPointerException   clojure.zip/next (zip.clj:236) 
  
  Any ideas? 
  
  Thanks for help. 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.com 
 javascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  Clojure group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/d/optout. 


-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 zippers to traverse it:

  (defn traverse [col]
   (loop [z col]
 (if (= (z/next z) z)
 z
 (if (z/branch? z)
   (recur (z/next z))
   (recur (- z println z/next))


 But I'm getting: NullPointerException   clojure.zip/next (zip.clj:236)

 Any ideas?

 Thanks for help.

 --
 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 members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
 children nil}]} {n {id b} d 3 children nil}]) 
  
  
  I want to find the map that has value c for id. If found, I need to 
 return the map {n {id c} d 4 children nil} 

 One way to do this follows. First get all of the sub-maps, which you can 
 do with the following two functions: 

 (defn get-lower [x] (tree-seq coll? identity x)) 

 (defn get-maps-from-lower [x] (filter map? (get-lower x))). 

 The first function gets all of the lower level colls, the second picks the 
 maps out of those colls. 

 You then need a function that will rummage round in a coll x looking to 
 see if it has the relevant element r: 

 (defn rummager [x r] (some #(= r %) x)) 

 You then use rummager to get maps with the appropriate val 

 (defn get-map-with-val [v x] 
   (first (filter #(rummager (vals %) v) (get-maps-from-lower x. 

 Trying this out in the repl I get 

 = (get-map-with-val {id c} s) 

 {d 4, n {id c}, children nil} 

 which I believe is the result you wanted. 

 Alan

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 (nil? loc) (z/end? loc)))

and then iterating while not stop?

I also remember running into a situation where loc wasn't nil but z/node
was(!).

I can't recall the exact details but that might help...

Hussein B. writes:

 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))
   (recur (- z println z/next))


 But I'm getting: NullPointerException   clojure.zip/next (zip.clj:236)

 Any ideas?

 Thanks for help.

--
Sent with my mu4e

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 zipper, but an input to a zipper.  Unless 
 you've written a zipper you omitted from your post, zipping over maps, 
 in particular, may not be as convenient as you're imagining. 
 https://clojuredocs.org/clojure.zip/zipper has helpful examples in it. 

 Take care, 
 Moe 

 On Fri, Aug 21, 2015 at 5:06 PM, Hussein B. hubag...@gmail.com 
 javascript: wrote: 
  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 PM, Hussein B. hubag...@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 zippers to traverse it: 
   
(defn traverse [col] 
 (loop [z col] 
   (if (= (z/next z) z) 
   z 
   (if (z/branch? z) 
 (recur (z/next z)) 
 (recur (- z println z/next)) 
   
   
   But I'm getting: NullPointerException   clojure.zip/next 
 (zip.clj:236) 
   
   Any ideas? 
   
   Thanks for help. 
   
   -- 
   You received this message because you are subscribed to the Google 
   Groups Clojure group. 
   To post to this group, send email to clo...@googlegroups.com 
   Note that posts from new members are moderated - please be patient 
 with 
   your 
   first post. 
   To unsubscribe from this group, send email to 
   clojure+u...@googlegroups.com 
   For more options, visit this group at 
   http://groups.google.com/group/clojure?hl=en 
   --- 
   You received this message because you are subscribed to the Google 
   Groups 
   Clojure group. 
   To unsubscribe from this group and stop receiving emails from it, 
 send 
   an 
   email to clojure+u...@googlegroups.com. 
   For more options, visit https://groups.google.com/d/optout. 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.com 
 javascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  Clojure group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/d/optout. 


-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 cases, but there
may well be a more compact way to accomplish your goal.  What do you
want to do with the piece of data?

Take care,
Moe

On Fri, Aug 21, 2015 at 5:57 PM, Hussein B. hubaghd...@gmail.com wrote:
 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 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 zipper, but an input to a zipper.  Unless
 you've written a zipper you omitted from your post, zipping over maps,
 in particular, may not be as convenient as you're imagining.
 https://clojuredocs.org/clojure.zip/zipper has helpful examples in it.

 Take care,
 Moe

 On Fri, Aug 21, 2015 at 5:06 PM, Hussein B. hubag...@gmail.com wrote:
  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 PM, Hussein B. hubag...@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 zippers to traverse it:
  
(defn traverse [col]
 (loop [z col]
   (if (= (z/next z) z)
   z
   (if (z/branch? z)
 (recur (z/next z))
 (recur (- z println z/next))
  
  
   But I'm getting: NullPointerException   clojure.zip/next
   (zip.clj:236)
  
   Any ideas?
  
   Thanks for help.
  
   --
   You received this message because you are subscribed to the Google
   Groups Clojure group.
   To post to this group, send email to clo...@googlegroups.com
   Note that posts from new members are moderated - please be patient
   with
   your
   first post.
   To unsubscribe from this group, send email to
   clojure+u...@googlegroups.com
   For more options, visit this group at
   http://groups.google.com/group/clojure?hl=en
   ---
   You received this message because you are subscribed to the Google
   Groups
   Clojure group.
   To unsubscribe from this group and stop receiving emails from it,
   send
   an
   email to clojure+u...@googlegroups.com.
   For more options, visit https://groups.google.com/d/optout.
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clo...@googlegroups.com
  Note that posts from new members are moderated - please be patient with
  your
  first post.
  To unsubscribe from this group, send email to
  clojure+u...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  ---
  You received this message because you are subscribed to the Google
  Groups
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send
  an
  email to clojure+u...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

 --
 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 members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 is left in case of regressions for now.

Take care,
Moe

On Fri, Aug 21, 2015 at 12:02 PM, William la Forge laforg...@gmail.com wrote:
 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 worry
 about using is as a starting point since the code is apparently
 unreferenced.


 On Friday, August 21, 2015 at 6:37:48 AM UTC-4, William la Forge wrote:

 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 Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 dealing about advanced algorithms
 in Clojure has hit the shelves. Please head over to:


 https://www.packtpub.com/application-development/clojure-data-structures-and-algorithms-cookbook

 Rafik

 --
 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 members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 as 
 well. But that's because of the other author's licensing. If that library 
 has a license that doesn't require source distribution, who am I to ask for 
 that.

 Not directly related to licensing but my main intent is to get people to 
 write games and share them. Not necessarily as a commercial activity but 
 game development for game development's sake. Commercial side is IMO 
 already covered well.


LGPL might be a better choice than GPL in that case, as LGPL doesn't 
dictate terms for everything that ever gets linked to your code, while 
still providing GPL-like terms for your own code. 

-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.