I agree when you print to stdout you'd expect lazily evaluated output to be 
mangled in.

However, it would seem more natural to me that if you print something to a 
string it is counter intuitive for incidental writes to stdout to be 
redirected to the string, as well- There is also nothing in the 
documentation that suggests this would happen.

Also, it would be technically relatively easy to change this.

On Saturday, February 9, 2013 12:46:08 PM UTC-6, AtKaaZ wrote:
>
> here's a simpler example:
> => (map println '(1 2 3))
> (1
> 2
> nil 3
> nil nil)
> => (dorun (map println '(1 2 3)))
> 1
> 2
> 3
> nil
>
>
>
> On Sat, Feb 9, 2013 at 7:44 PM, AtKaaZ <atk...@gmail.com <javascript:>>wrote:
>
>> actually replacing vec with dorun or doall, would've been a better 
>> example :)
>>
>>
>> On Sat, Feb 9, 2013 at 7:42 PM, AtKaaZ <atk...@gmail.com <javascript:>>wrote:
>>
>>> I think it's an illusion from being lazy ?
>>> => (def k (pr-str (vec (for [x (range 5)] 
>>>                                 (do (pr x) 
>>>                                      x)))))
>>> 01234
>>> #'datest1.ret/k
>>> => k
>>> "[0 1 2 3 4]"
>>>
>>>
>>>
>>> On Sat, Feb 9, 2013 at 7:30 PM, Conrad <drc...@gmail.com 
>>> <javascript:>>wrote:
>>>
>>>> I tested this in the latest 1.5.0-RC6:
>>>>
>>>> => (def k (pr-str (for [x (range 5)] 
>>>>                              (do (pr x) 
>>>>                                   x))))
>>>> #'user/k
>>>> => k
>>>> "(012340 1 2 3 4)"
>>>>
>>>> This seems wrong to me... I can see what would be needed to fix it in 
>>>> clojure/core.clj, but it would require creating several additional private 
>>>> functions. Does anyone know if this behavior is intentional?
>>>>  
>>>> -- 
>>>> -- 
>>>> 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/groups/opt_out.
>>>>  
>>>>  
>>>>
>>>
>>>
>>>
>>> -- 
>>> Please correct me if I'm wrong or incomplete,
>>> even if you think I'll subconsciously hate it.
>>>
>>>  
>>
>>
>> -- 
>> Please correct me if I'm wrong or incomplete,
>> even if you think I'll subconsciously hate it.
>>
>>  
>
>
> -- 
> Please correct me if I'm wrong or incomplete,
> even if you think I'll subconsciously hate it.
>
>  

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