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 <rubing...@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 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.
>

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