patched up array comprehensions somewhat. Parens are still a necessary evil, and there's still probably plenty of edge cases

This commit is contained in:
Jeremy Ashkenas
2009-12-18 22:30:09 -05:00
parent 7ec6300a48
commit d73ff9a79f
6 changed files with 913 additions and 848 deletions

View File

@@ -109,9 +109,9 @@ change_a_and_set_b: =>
b: 20
# Array comprehensions.
supper: food.capitalize() for food in ['toast', 'cheese', 'wine'].
supper: [food.capitalize() for food in ['toast', 'cheese', 'wine']]
drink(bottle) for bottle, i in ['soda', 'wine', 'lemonade'] if even(i).
[drink(bottle) for bottle, i in ['soda', 'wine', 'lemonade'] if even(i)]
# Switch statements ("else" serves as a default).
switch day