On Tue, Jan 15, 2013 at 2:17 PM, David Sargeant david@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.
David
countdown = (num for num in [10..1])
In Common Lisp—and Parenscript—that would be
(loop for num :from 10 :to 1 collect num)
Which expands to roughly the same JS code.
— B. Smilga.