Re: map output to string

2014-07-08 Thread Glen Rubin
Thanks Lee. You are correct there is something wrong with my input to this function that is causing the problem, not the function. Sorry for the error. On Tuesday, July 8, 2014 8:13:36 PM UTC-7, Lee wrote: > > > Hi Glen, > > You haven't really provided what we would need to replicate your pro

Re: map output to string

2014-07-08 Thread Lee Spector
Hi Glen, You haven't really provided what we would need to replicate your problem. Specifically: - You call but don't provide definitions for address or is-blank? - You refer to unbound symbols some-string and another-string. - You don't provide an input for report, or the top-level call you

Re: map output to string

2014-07-08 Thread Glen Rubin
I am still having difficulties with this, so let me clarify by showing some sample code. My fn looks like this: (defn report [text] (str "string1" "string2" (apply str (map-indexed (fn [idx itm] (time-text idx itm)) (filtered-list text)) When I invoke spit in order to output a tex

Re: map output to string

2014-07-08 Thread Diego Basch
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

Re: map output to string

2014-07-08 Thread Lee Spector
Sometimes you have to manually stamp out laziness, for this among other reasons. In some cases I apply the list function to do this: => (str (map inc (range 10))) "clojure.lang.LazySeq@c5d38b66" => (str (apply list (map inc (range 10 "(1 2 3 4 5 6 7 8 9 10)" -Lee > On 8 July 2014 09:49,

Re: map output to string

2014-07-08 Thread Daniel Compton
To force realisation of a sequence, use one of the do* forms. https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/do If you post a gist of your code then someone may be able to give more specific guidance. Daniel. > On 8/07/2014, at 2:15 pm, Glen Rubin wrote: > > yes, that

Re: map output to string

2014-07-07 Thread Glen Rubin
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

Re: map output to string

2014-07-07 Thread Daniel Compton
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 is

map output to string

2014-07-07 Thread Glen Rubin
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 si