inconsistent range keywords "from" and "to" #67

benwbooth opened this Issue Jun 22, 2011 · 1 comment


None yet

2 participants


Currently, the syntax for specifying a range starting from 0 in a for loop is:
i for i from 3

[ 0, 1, 2 ]

I think it could be more intuitively written this way:
i for i til 3

from should specify the starting value, and til or to should specify the ending value. If from is omitted, it should default to zero. This would be more consistent with specifying a start and stop value:
i for i from 0 til 3


This from N sugar originates from range N of Python/Clojure etc., where the shorthand notation specifies the end part rather than start. I agree that it can feel a little strange English-wise.

i for i til 3

I like it. Though a little challenging lexing-wise (to/til is contextual to from right now).

@satyr satyr added a commit that closed this issue Jun 25, 2011
@satyr closes #67; made `from` optional 9880b47
@satyr satyr closed this in 9880b47 Jun 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment