July 25, 2012 - TC39 Meeting Notes
brendan at mozilla.org
Tue Aug 14 08:41:04 PDT 2012
Allen Wirfs-Brock wrote:
> On Aug 14, 2012, at 4:20 AM, Andreas Rossberg wrote:
>> > On 29 July 2012 03:58, Brendan Eich<brendan at mozilla.org> wrote:
>>> >> Allen Wirfs-Brock wrote:
>>>> >>> I really think in a language where we have both [[Put]] and
>>>> >>> [[DefineOwnProperty]] semantics that we really need both = and :=
>>> >> I can buy that, and I'm glad you mention := as it is not just an assignment
>>> >> operator (e.g. in Pascal or Ada), it's also Go's declare-and-init operator.
>>> >> It has the right characters, fuzzy meaning from other languages, and the
>>> >> critical = char in particular.
>> > There is a far longer tradition and a significantly larger body of
>> > languages that use = for definition and := for assignment (including
>> > all languages in the Algol& Pascal tradition). So going with an
>> > inverted meaning in JS sounds like an awful idea to me (as does using
>> > Go for inspiration about anything related to declaration syntax;) ).
> About as awful as using [ ] as the indexing operator when every FORTRAN programmer knows that ( ) is how you do subscripting. Not to mention what Smalltalk programmers think [ ] means.
> There is value in using familiar looking symbols but I think it is unrealistic to expect common semantics among different languages.
After more soak-time on this, I'm on Andreas's side.
Yes, symbols will be used differently by different languages. No, () for
indexing is not expected in modern languages -- Fortran like Disco and
the American Drive-In may never die, but it is rare to find in the wild
or taught in universities.
Doug's confusion was not unique. We may want syntax for redefinition,
but assignment is the dominant trope and it will still be even with :=
or <- or whatever the syntax might be. Perhaps syntax is not needed so
much as Object.define and good docs for when to use it.
More information about the es-discuss