On Sun, Mar 3, 2013 at 7:06 PM, Lee Spector <lspec...@hampshire.edu> wrote:

> So now I'm just checking for () and handling it specially, and that works.
> But still it doesn't seem right that  (str ()) =>
> "clojure.lang.PersistentList$EmptyList@1" and I wouldn't be surprised if
> this tripped up others in the future (and maybe me too once I forget about
> it :-).
>
>
I have gotten burned by this, you're not alone.  (Although I would expect
it to produce "()", not "" as you expected).

Similarly, I've had times where I called (str s) on a list, expecting it to
print like a list, but it turned out that s wasn't truly a list, it was
actually a lazy seq, which just prints the type, much like your empty list
example.

I know there have been some recent improvements surrounding reading and
writing data structures.  Is there a way to just say, "Convert this to a
string that corresponds to the way it prints at the REPL"?

-- 
-- 
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/groups/opt_out.


Reply via email to