On Wed, Dec 30, 2015 at 8:31 AM, Nicolas B. Pierron <nicolas.b.pier...@mozilla.com> wrote: > Note, do we want to distinguish the binary operator Symbol['_+_'] from > the unary operator Symbol['+_']. > Also, I am not sure how extendable the language is, especially if we > are looking for operators like Symbol['_>>=_'].
The "C++ way" of naming these would probably be nicer, but maybe something like this: obj[Symbol['operator+']] = (lhs, rhs) => ... obj[Symbol['++operator'] = (rhs) => ... obj[Symbol['operator>>='] = (lhs, rhs) => ... I saw that you wanted to say where the operator appears (if it's binary, unary, postfix, or prefix) depending on the _ - but certain operators (like >>=) can only be binary operators so there wouldn't be any confusion unless we want to get into the land of defining custom operators like in Ruby. :-) _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss