Re: A question about lazy seq with io

2014-01-13 Thread Kashyap CK
Thank you very very much Jan idiomatic is what I need to learn :) Regards, Kashyap On Tuesday, January 14, 2014 12:47:19 AM UTC+5:30, Jan Herich wrote: > > As Mauricio already mentioned, map is not meant to be used for > side-effects, if you want to need to evaluate a sequence for side-effec

Re: A question about lazy seq with io

2014-01-13 Thread Jan Herich
As Mauricio already mentioned, map is not meant to be used for side-effects, if you want to need to evaluate a sequence for side-effects, use doseq instead. Regarding your first question about explicit loop-recur, i think it's reasonable w

Re: A question about lazy seq with io

2014-01-13 Thread Kashyap CK
Thanks Mauricio ... I think I understand it now. Regards, Kashyap On Monday, January 13, 2014 9:48:28 PM UTC+5:30, Mauricio Aldazosa wrote: > > > > On Mon, Jan 13, 2014 at 8:49 AM, Kashyap CK > > wrote: > >> >> I'd really appreciate it if someone could tell me what's going on when I >> do the fo

Re: A question about lazy seq with io

2014-01-13 Thread Mauricio Aldazosa
On Mon, Jan 13, 2014 at 8:49 AM, Kashyap CK wrote: > > I'd really appreciate it if someone could tell me what's going on when I > do the following - > > user> (defn xx [] (map println [1 2 3 4 5 6])) > #'user/xx > user> (take 2 (xx)) > (1 > 2 > 3 > 4 > 5 > 6 > nil nil) > user> > There are many t

A question about lazy seq with io

2014-01-13 Thread Kashyap CK
Hi, I've been dabbling with Clojure for a bit and I am really loving it!!! I am trying to write a clojure program to download a bunch of URLs and I was wondering what is the right way to do it - My current implementation is as follows (def url-sequence (map #(str "http://www.mysite.com/list.php

Re: A question about lazy-seq fn.

2011-10-13 Thread Stephen Compall
On Thu, 2011-10-13 at 21:38 -0700, mmwaikar wrote: > Most of the examples I see about using the lazy-seq fn. make use of cons to > build the list (or a seq). > > Can we not use lazy-seq with a conj? And why? Not really. user=> (clojure-version) "1.3.0" user=> (do (cons 88 (map prn [4 6])) nil)

A question about lazy-seq fn.

2011-10-13 Thread mmwaikar
Hi, Most of the examples I see about using the lazy-seq fn. make use of cons to build the list (or a seq). Can we not use lazy-seq with a conj? And why? If it possible to use lazy-seq with a conj, then an example would be great. Thanks, Manoj. -- You received this message because you are subs

Re: about lazy-seq

2011-07-02 Thread kawas
                 (cond > >                      (> low 1) > >                        (step (rest coll) (dec low) (dec high)) > >                      (and (= low 1) (>= high 1)) > >                        (cons (first coll) (step (rest coll) low (dec > > high

Re: about lazy-seq

2011-07-01 Thread Alan Malloy
> > Unexpectedly, this is not lazy, it seems like I'm hanging onto my > head. > Is lazy-seq creating some kind of closure with my collection in it ? > How about lazy-seq, tail call and closure clearing ? > > regards, > -- > kawas -- You received this message be

about lazy-seq

2011-07-01 Thread kawas
it seems like I'm hanging onto my head. Is lazy-seq creating some kind of closure with my collection in it ? How about lazy-seq, tail call and closure clearing ? regards, -- kawas -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t