Skip to content

Commit

Permalink
we badly need sugar for accessing the last element of an array
Browse files Browse the repository at this point in the history
Compile to something like `array.length > 0 ? array[array.length - 1] : void 0`

See jashkenas/coffeescript#156 and others.
  • Loading branch information
michaelficarra committed Jan 14, 2013
1 parent 14a407a commit a62fb4e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ have done.
[#1208](https://github.com/jashkenas/coffee-script/issues/1208))

## additions
+ `@@` as sugar for `@constructor`
+ `@0`, `@1`, etc. for `this[0]`, `this[1]`, etc.
+ `a.0.1` for `a[0][1]` ([#918](https://github.com/jashkenas/coffee-script/issues/918),
[#1334](https://github.com/jashkenas/coffee-script/issues/1334))
+ partially-applied operators and member accesses ([gkz/LiveScript@37ef73b7](https://github.com/gkz/LiveScript/commit/37ef73b702c32263aeba9bdd3ebadc3823fd5eda), [gkz/LiveScript#41](https://github.com/gkz/LiveScript/issues/41))
+ unary operators are functions ([gkz/LiveScript@c13b8a60](https://github.com/gkz/LiveScript/commit/c13b8a60564c16b78fd82548c01b092724f7e476))
+ backcalls, a flat call/cc via `<-`:
Expand All @@ -57,6 +53,11 @@ have done.
[gkz/LiveScript@fb548f23](https://github.com/gkz/LiveScript/commit/fb548f23df6273c4fc6ca4359cd8e1ee93ce42a1))
+ `%%` (mod) and `//` (integer division) operators ([#1971](https://github.com/jashkenas/coffee-script/issues/1971))
+ min/max operators (satyr/coco): `<?`, `>?`
+ sugar for accessing the last element of an array-like, syntax TBD (https://github.com/jashkenas/coffee-script/issues/156)
+ `@@` as sugar for `@constructor`
+ `@0`, `@1`, etc. for `this[0]`, `this[1]`, etc.
+ `a.0.1` for `a[0][1]` ([#918](https://github.com/jashkenas/coffee-script/issues/918),
[#1334](https://github.com/jashkenas/coffee-script/issues/1334))
+ underscore in number literals; postfix alphabetic comments: `15_550km`
([#632](https://github.com/jashkenas/coffee-script/issues/632),
[#857](https://github.com/jashkenas/coffee-script/issues/857),
Expand Down

0 comments on commit a62fb4e

Please sign in to comment.