Closed kenchris closed 8 years ago
Technically we could use "..", but I don't think it's visually distinct enough. We want it to look pleasing, but obviously different from property lookup.
..
more interesting as cascade operator (forced return this
) like in Dart or LiveScript.
[2, 7, 1, 8]
..push(3)
..shift()
..sort(); // => [1,3,7,8]
Just remember that ...
is the spread operator. Consider this:
[..other_fn_that_is_iterable]
vs
[...other_fn_that_is_iterable]
Would have loved to use &
over either of these but since that one's out my vote's for sticking with ::
Too much potential for confusion and I'd prefer to see ..
reserved for ranges 1..10
Agreed, let's stick with ::
.
It looks more similar to . and Dart uses it as well.
Though it might be a problem with 1..toString()