> That code doesn't work properly in parenscript, btw. It does not decrement.
PS's LOOP works just like CL's in this respect, so what Boris meant to
say was :DOWNTO rather than :TO. There are four options here. :TO and
:DOWNTO are inclusive, while :BELOW and :ABOVE are exclusive:
(loop :for num :from 1 :to 10 :collect num)
=> (1 2 3 4 5 6 7 8 9 10)
(loop :for num :from 10 :downto 1 :collect num)
=> (10 9 8 7 6 5 4 3 2 1)
(loop :for num :from 1 :below 10 :collect num)
=> (1 2 3 4 5 6 7 8 9)
(loop :for num :from 10 :above 1 :collect num)
=> (10 9 8 7 6 5 4 3 2)
Daniel
On Tue, Jan 15, 2013 at 1:18 PM, David Sargeant
<david@dsargeant.com> wrote:
That code doesn't work properly in parenscript, btw. It does not decrement.
(function () {
var collect66 = [];
for (var num = 10; num <= 1; num += 1) {
collect66['push'](num);
};
return collect66;
})();