Gary, I fully acknowledge that there are many ways to create lazy sequences 
that are much more elegant and efficient. However, as I mentioned, I'm very 
fascinated by generators in Python, and I mostly wanted to toy around with 
how to implement it in Clojure. Also, as I mentioned, for beginners who are 
not well-versed in Clojure laziness, it's easy to use generators in 
combination with the "loop" macro (or other more imperative macros) for a 
lazy but still functional-ish sequence. However, I'm probably not going to 
use this library for any of my own projects. :-)

Thanks for the comments.
--Alex

On Wednesday, June 4, 2014 8:50:21 AM UTC-7, tbc++ wrote:
>
> A little known fact is that the guts of the go macro are quite flexible. 
> We use this in the test framework:
>
>
> https://github.com/clojure/core.async/blob/master/src/test/clojure/clojure/core/async/ioc_macros_test.clj#L17
>
> I also spent some time once and created a yield like macro:
>
>
> https://github.com/halgari/async-bench/blob/master/src/async_bench/core.clj#L64
>
> WARNING: this uses unpublished APIs from core.async, use at your own risk. 
>
> Timothy
>
>
> On Wed, Jun 4, 2014 at 9:43 AM, Gary Johnson <gwjo...@uvm.edu 
> <javascript:>> wrote:
>
>> What new features does this syntax provide over the existing infinite 
>> sequence generators?
>>
>> - lazy-seq
>> - iterate
>> - repeat
>> - repeatedly
>> - range
>>
>> I realize you provided a simple example for clarity, but perhaps you 
>> could illustrate something more complex that couldn't be done with the 
>> above functions easily. For example, the case you provided could be written 
>> as follows:
>>
>> (take 5 (iterate inc 1))
>>
>>   Thanks,
>>     ~Gary
>>
>> -- 
>> 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 
>> <javascript:>
>> 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 <javascript:>
>> 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 <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> “One of the main causes of the fall of the Roman Empire was that–lacking 
> zero–they had no way to indicate successful termination of their C 
> programs.”
> (Robert Firth) 
>

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