Re: Trying to use lazy-seq for the first time, failing.

2009-06-29 Thread Emeka
Harold, Do you have any material on Factor? I won't going through it. Regards, Emeka On Sat, Jun 27, 2009 at 12:23 AM, _hrrld hhaus...@gmail.com wrote: Hi, I'm trying to use lazy-seq to implement a cool piece of functionality I saw in the Factor programming language. Here is the

Re: Trying to use lazy-seq for the first time, failing.

2009-06-29 Thread _hrrld
On Jun 29, 1:15 am, Emeka emekami...@gmail.com wrote: Harold, Do you have any material on Factor? I won't going through it. Emeka, Many of these links are relevant: http://www.google.com/search?q=factor+language Regards, -Harold --~--~-~--~~~---~--~~ You

Re: Trying to use lazy-seq for the first time, failing.

2009-06-29 Thread Emeka
Thanks, however I have that already :) Regards, Emeka On Mon, Jun 29, 2009 at 2:36 PM, _hrrld hhaus...@gmail.com wrote: On Jun 29, 1:15 am, Emeka emekami...@gmail.com wrote: Harold, Do you have any material on Factor? I won't going through it. Emeka, Many of these links are

Re: Trying to use lazy-seq for the first time, failing.

2009-06-27 Thread Meikel Brandmeyer
Hi, Am 27.06.2009 um 02:23 schrieb _hrrld: Am I doing something silly? Or perhaps I've misunderstood lazy-seq's operation. I think, it's the latter. Here my try on an explanation: lazy-seq returns a value, which implements ISeq, ie. the seq interface. The code inside the lazy-seq is used to

Re: Trying to use lazy-seq for the first time, failing.

2009-06-27 Thread Jarkko Oranen
On Jun 27, 3:23 am, _hrrld hhaus...@gmail.com wrote: Hi, I'm trying to use lazy-seq to implement a cool piece of functionality I saw in the Factor programming language. Here is the documentation for that functionality:http://docs.factorcode.org/content/word-produce,sequences.html I think

Re: Trying to use lazy-seq for the first time, failing.

2009-06-27 Thread arasoft
I think you just forgot to return the value itself. This seems to work: (defn produce [value predicate generator] (when (predicate value) (let [result (generator value)] (cons result (lazy-seq (produce result predicate generator) ) And I would use quot instead of

Re: Trying to use lazy-seq for the first time, failing.

2009-06-27 Thread Jarkko Oranen
On Jun 27, 3:23 am, _hrrld hhaus...@gmail.com wrote: Hi, I'm trying to use lazy-seq to implement a cool piece of functionality I saw in the Factor programming language. Here is the documentation for that functionality:http://docs.factorcode.org/content/word-produce,sequences.html I

Re: Trying to use lazy-seq for the first time, failing.

2009-06-27 Thread _hrrld
On Jun 27, 9:48 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 27.06.2009 um 02:23 schrieb _hrrld: Am I doing something silly? Or perhaps I've misunderstood lazy-seq's operation. I think, it's the latter. Here my try on an explanation: (snip...) I found your explanation cogent and

Re: Trying to use lazy-seq for the first time, failing.

2009-06-27 Thread Wrexsoul
On Jun 26, 8:23 pm, _hrrld hhaus...@gmail.com wrote: Hi, I'm trying to use lazy-seq to implement a cool piece of functionality I saw in the Factor programming language. Here is the documentation for that functionality:http://docs.factorcode.org/content/word-produce,sequences.html I think