3 ms·
The {x,y} rvalue syntax isn't in the CoffeeScript documentation. This is the first place I've seen it.
by tomstuart 15y ago
The {x,y} rvalue syntax isn't in the CoffeeScript documentation. This is the first place I've seen it.
- grayrest 15y agoIt was but it got dropped in the doc update for 0.4 or thereabouts. I was hoping he'd take it out for a while because it complicates the disambiguation of braceless object literals but it seems most people like it, so meh.
- tomstuart 15y agoIt's a bit weird that it breaks alpha equivalence (i.e. you expect your program's semantics to be invariant under local variable renaming) but I can see why people like it. It's certainly compact and idiomatic, and there's a nice (albeit superficial) symmetry with destructuring assignment.