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 <gwjoh...@uvm.edu> 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 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.
>



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