Brendan Eich (2014-01-24T00:25:39.000Z)
domenic at domenicdenicola.com (2014-01-27T15:51:26.117Z)
Tab Atkins Jr. wrote: > Using value objects would make this explicit, and would allow > convenient operator overloading, so you can do: > > ```js > var x = CSS.px(5); > var y = CSS.px(10); > var z = x + y; > ``` With value objects, you could do even better: ```js // something declarative to import suffix px as CSS.px here let x = 5px; let y = 10px; let z = x + y; ``` > I'm okay with this being 1 or 2 years down the road. That's my time frame, and ES7's. > Alternately, how close can I get to truly immutable objects? I want > something that can't be expando'd or altered in any way, so our impl > can share objects when possible. Without value objects, you have reference-based identity, so ```js CSS.px(5) !== CSS.px(5) ``` No bueno. You want value objects. Working on it for next week's TC39 meeting.