Closed anko closed 8 years ago
Still needs appropriate changes to docs and doc-tests before merge, but this is what it would functionally look like.
Having played with this for a while, I'm having second thoughts. I'll summarise.
Points in favour:
(. a "hi")
compiles to a['hi'];
. One might reasonably expect that the literal "hi"
can be replaced with an identifier containing the same value, like (. a b)
, but that currently compiles to a.b;
, which has a different meaning. This is confusing.get
could go.Points against:
(. a "b")
compiles to a.b;
, then how do you get a["b"];
? (And vice-versa.) The distinction matters. JavaScript has two constructs for member expressions; .
for static and []
for computed, so we're losing generality.(. Array "prototype" "slice" "call")
to produce Array.prototype.slice.call;
is quite grating compared to the current (. Array property slice call)
.After much further deliberation detailed in the above comment and the original issue #13's closing comments here, I've concluded that these changes are unworkable.
If the described behaviour is of particular importance for some use-case, it could be implemented by a user macro.
Details in a0fa525. Fixes #13. Breaks API, so would be a minor-version bump.
@tabatkins :+1:?