On Mar 21, 2009, at 1:44 PM, Mark Triggs wrote:
>
>   user=> (str (filter even? (range 1 10)))
>   "clojure.lang.lazy...@f1005"
>
> Previously this would readably print the contents of the seq and some
> of my code was relying on this.  Obviously it's not difficult to call
> `prn-str' myself, but I just wondered if this change was made
> consciously.
>

According to the documentation for 'str':
With one arg x, returns x.toString().

So it looks like toString() on a sequence used to return its contents  
and now doesn't. However, rather than relying on this behavior what  
you probably should be doing is using 'apply':
(apply str (filter even? (range 1 10))) => "2468"

If you want commas between those elements, use 'interpose':
(apply str (interpose ", " (filter even? (range 1 10)))) => "2, 4, 6, 8"

Aloha,
David Sletten

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

Reply via email to