changing array comprehension filters from 'where' to 'when' to mirror case/when

This commit is contained in:
Jeremy Ashkenas
2009-12-29 09:55:37 -05:00
parent a3129e05ae
commit ae112d6087
5 changed files with 22 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
nums: n * n for n in [1, 2, 3] where n % 2 isnt 0
nums: n * n for n in [1, 2, 3] when n % 2 isnt 0
results: n * 2 for n in nums
# next: for n in [1, 2, 3] if n % 2 isnt 0

View File

@@ -21,7 +21,7 @@ func: =>
text = c.text
}
c.list: l for l in d.text.split('') where l is '-'
c.list: l for l in d.text.split('') when l is '-'
c.single: c.list[1..1][0]