> eat food for food in foods when food isn't 'chocolate'
> from the CoffeeScript tutorial...Furthermore, until you finish reading the line it isn’t clear which foods will be eaten.
The thing with typing the filter at the end is, that format has its basis in mathematical notation, particularly in set theory. Using an even terser mathematical syntax/notation, you could write the same expression this way:
You read that as "the set of eat(food) where for all food in the set of foods, the food isn't chocolate". The notation will be quite familiar to mathematicians, and thus if you have a strong mathematical background, especially in set theory, discrete math, and combinatorics, the CoffeeScript array comprehension feels natural.
> from the CoffeeScript tutorial...Furthermore, until you finish reading the line it isn’t clear which foods will be eaten.
The thing with typing the filter at the end is, that format has its basis in mathematical notation, particularly in set theory. Using an even terser mathematical syntax/notation, you could write the same expression this way:
You read that as "the set of eat(food) where for all food in the set of foods, the food isn't chocolate". The notation will be quite familiar to mathematicians, and thus if you have a strong mathematical background, especially in set theory, discrete math, and combinatorics, the CoffeeScript array comprehension feels natural.See the Wikipedia article on Set-nuilder Notation/Set comprehension, http://en.wikipedia.org/wiki/Set_comprehension.
Here's another example from the Wikipedia article:
This reads as "the set of all x, where x is a real number and x = x^2", which evaluates to the set { 0, 1 }.