That's not your problem. From (doc str):

"With more than one arg, returns the concatenation of the str values of the 
args."

The str value of a lazy sequence is something like:

"clojure.lang.LazySeq@386e0460"
which is the result of (.toString your-seq)

What you probably want is something like

(str s1 s2 s3 (apply str your-seq) s4...)


On Monday, July 7, 2014 11:15:13 PM UTC-3, Glen Rubin wrote:
>
> yes, that is exactly my issue. i am trying to get the lazy sequence fully 
> realized as you say, but it's not happening in the context i put it in.  
>
> On Monday, July 7, 2014 6:04:00 PM UTC-7, Daniel Compton wrote:
>>
>> Hi Glen
>>
>> One thing to keep in mind with lazy sequences is that running them at the 
>> REPL will force them to be fully realised, whereas a lazy sequence may not 
>> be realised in other contexts. I didn't understand where 'clojure-lazy-seq' 
>> is coming from in your question so I'm not sure if that's your issue or not.
>>
>>
>> On 8 July 2014 09:49, Glen Rubin <rubi...@gmail.com> wrote:
>>
>>> my-fn takes a number and a string as argument and outputs a string.  I 
>>> am using map-indexed and my-fn to comprehend a list of items with numbered 
>>> index as follows, 
>>>  
>>>  
>>> (map-indexed (fn [idx itm]  (my-fn idx itm)) '(list-of-crap))
>>>  
>>> When i run this on the repl everything works well and I get a 
>>> single long string of output. But, I am trying to use the output of this 
>>> function in a report and it is not working in that context.
>>>  
>>> The code to generate report looks something like this:
>>>  
>>>  (str
>>>       string1
>>>       string2
>>>       string3
>>>     (map-indexed (fn [idx itm] (my-fn idx itm)) '(listofcrap))
>>>       string4....etc...
>>> )
>>>  
>>> The code above will just print out 'clojure-lazy-seq' instead of the 
>>> string output.  If I try:
>>>  
>>> (apply str  (map-indexed (fn [idx itm] (my-fn idx itm)) '(listofcrap)))
>>>  
>>> Then I get the last item from my list properly formated in the report, 
>>> but that's all.  How do I print out everything?  Thanks
>>>
>>> -- 
>>> 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
>>> 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
>>> 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.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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/d/optout.

Reply via email to