strawman for the := operator

David Herman dherman at
Wed Aug 8 15:31:22 PDT 2012

On Aug 8, 2012, at 2:23 PM, Brendan Eich wrote:

>> So if we do add :=, we should allow it to work on variables too, for consistency. 
> See above -- := is not a drop-in replacement for =. Think of it more like the .{ proposal...

With too many of these conversations about various "modify an object" operators, we've started from "here's a thing let's talk about it" rather than "here's the problem we're trying to solve." Specifically, for there to be dedicated syntax, the bar is high to prove that it pays for itself.

Every time we talk about an operator whose semantics is based off of defineProperty, I'm skeptical that it's providing real programmer benefit, as opposed to sort of "completing the set" of semantic operations with dedicated syntax. Object.defineProperty is a fine thing to have, and I'm glad ES5 added it, but IMO it's a lower-level reflection operation, not a common operation. Allen should correct me, but I think he doesn't disagree, since he says:

> And, := should not be thought of or become the common way to do assignment.   That should remain the job of =

If it's not common, then that's a strong case against getting dedicated syntax.


More information about the es-discuss mailing list