On Mar 3, 2013, at 10:26 PM, Mark Engelberg wrote:
> 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"?

Ah yes -- I agree that it should probably produce "()", and that would work 
fine in my application. I think I said "" only because I had just seen that 
(str nil) produces "". But yeah -- I agree that it should be "()".

I've also had the trouble you mention with lazy seqs, which can be annoying -- 
I find myself adding lots of code to de-lazify things -- but it's not quite as 
unexpected and bizarre as this issue with ().

FWIW I see also that:

(format "%s" ()) => "clojure.lang.PersistentList$EmptyList@1")

 -Lee

-- 
-- 
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