Hi guys,
I'm just wondering if it's possible for the following macro to be
written.
What's supposed to do is take an arbitrary-form, and create a lazy
sequence out of calls to "yield".
Here's an example:
(lazy-seq
(doseq i (range 3)
(yield i))
(if true
(yield "hello world")
(yield "dlrow olleh"))
(doseq j (range 2)
(doseq k (range 2)
(yield [j k]))))
This should produce the following lazy sequence:
0, 1, 2, "hello world", [0 0], [0 1], [1 0], [1 1]
It's important to me for the sequence to be genuinely lazy too. The
code to produce the corresponding values shouldn't even run, until the
values are needed.
Thanks for your help
-Patrick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---