4 ms·
> Assigning different semantics to two passages of code whose only syntactic difference is in the composition of their whitespace seems like it might be a misfe
by munificent 12y ago
> Assigning different semantics to two passages of code whose only syntactic difference is in the composition of their whitespace seems like it might be a misfeature.
I'll admit it's a bit iffy. However, newlines are already significant as statement separators, so this isn't totally outside the bounds of reason.
name = { "Fred" } // implicit return
This looks a little too similar to a setter definition to me. Also, it makes sense here, but would look really strange for a lambda:
people.map {= |person| person.name }
The typical solution is "=>", like:
people.map (person) => person.name
But then without a trailing delimiter, it's hard to chain multiple of these calls together, which is really common in list manipulation.