[parenscript-devel] Loops that return a value
boris.smilga at gmail.com
Tue Jan 15 15:29:44 UTC 2013
On Tue, Jan 15, 2013 at 2:17 PM, David Sargeant <david at dsargeant.com> wrote:
> It seems that the looping constructs don't currently return a value. In
> other words, they don't return an array of the results. CoffeeScript
> allows for both scenarios, that is, looping for side-effects and looping
> that returns an array of results. I'm thinking it would be very useful to
> have dotimes*, dolist*, for-in*, etc. that return an array of results.
> Below is an example from coffeescript.org. Let me know what you think.
> countdown = (num for num in [10..1])
In Common Lisp—and Parenscript—that would be
(loop for num :from 10 :to 1
Which expands to roughly the same JS code.
— B. Smilga.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the parenscript-devel