mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
converted the tests to use optional parentheses -- lot's of little subtleties to work out
This commit is contained in:
@@ -5,16 +5,16 @@ negs: negs[0..2]
|
||||
|
||||
result: nums.concat(negs).join(', ')
|
||||
|
||||
print(result is '3, 6, 9, -20, -19, -18')
|
||||
print result is '3, 6, 9, -20, -19, -18'
|
||||
|
||||
# Ensure that ranges are safe. This used to infinite loop:
|
||||
j = 5
|
||||
result: for j in [j..(j+3)]
|
||||
j
|
||||
|
||||
print(result.join(' ') is '5 6 7 8')
|
||||
print result.join(' ') is '5 6 7 8'
|
||||
|
||||
# With range comprehensions, you can loop in steps.
|
||||
results: x for x in [0..25] by 5
|
||||
|
||||
print(results.join(' ') is '0 5 10 15 20 25')
|
||||
print results.join(' ') is '0 5 10 15 20 25'
|
||||
Reference in New Issue
Block a user