removing object comprehensions from CoffeeScript, they were necessitating the generation of too much ugly JS

This commit is contained in:
Jeremy Ashkenas
2010-01-10 14:45:44 -05:00
parent 8ea75290b5
commit 13fc8aea04
14 changed files with 128 additions and 211 deletions

View File

@@ -4,14 +4,6 @@ results: n * 2 for n in nums
print(results.join(',') is '2,18')
obj: {one: 1, two: 2, three: 3}
names: key + '!' for value, key in obj
odds: key + '!' for value, key in obj when value % 2 isnt 0
print(names.join(' ') is "one! two! three!")
print(odds.join(' ') is "one! three!")
evens: for num in [1, 2, 3, 4, 5, 6] when num % 2 is 0
num *= -1
num -= 2