Also, what about this:
(loop [z (zip/seq-zip '((nil) 0))]
(if (zip/end? z)
:done
(do (println (zip/node z))
(recur (zip/next z)))))
Which produces:
((nil) 0)
(nil)
nil
0
:done
On Saturday, December 21, 2013 5:59:16 PM UTC-5, Lee wrote:
> On Dec 21, 2013, at 11:49 AM, Lee Spector wrote:
>
> >
> > When I step through a zipper made from a nested list via seq-zip, I get
> extraneous nils after processing a nested ().
> >
> > Is this somehow expected behavior, or a bug, or am I misunderstanding
> something fundamental?
> >
> > The problem seems to arise only when an nested empty list is present,
> not other nested lists and not other nested empty sequences (see example at
> bottom for this bit).
>
> I take it back about it working correctly with other nested empty
> sequences. I realize now that my example of that had a nested empty vector,
> not a sequence. Trying to reproduce that example with a nested empty
> sequence just confused me, because it turns out that (seq ()) = (seq []) =
> nil, and I'm not sure what that means... But this is all really a
> distraction from the case I care about, which is lists that contain (among
> other things) nested empty lists. For example, '(() 0). Here it seems to me
> that zip/next's behavior is clearly wrong and I'm not sure why or what to
> do about it.
>
> Thanks,
>
> -Lee
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.