using 'where' for array comprehension filtering, after kamatsu's suggestion -- execution tests pass now with significant whitespace

This commit is contained in:
Jeremy Ashkenas
2009-12-29 08:52:26 -05:00
parent cea417de02
commit 3fbb870d01
6 changed files with 26 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
func: =>
a: 3
b: []
while a >= 0
b.push('o')
a--
@@ -20,7 +21,7 @@ func: =>
text = c.text
}
c.list: l for l in d.text.split('') if l is '-'
c.list: l for l in d.text.split('') where l is '-'
c.single: c.list[1..1][0]