value objects

Brendan Eich brendan at mozilla.com
Tue Mar 27 12:03:17 PDT 2012


What Tab said about having "right" versions for the binary operators. 
Otherwise you can't properly handle number + decimal or number + 
complex, e.g.

The right and left methods proposed in 
http://wiki.ecmascript.org/doku.php?id=strawman:value_proxies seems 
worth a look, as well as the OOPSLA paper linked at the bottom.

/be

Allen Wirfs-Brock wrote:
> As a followup, I've written a strawman[1] that explains how we could 
> specify and implement operator overloading that supports an open-ended 
> set of value types.  I look at this as an adjunct to Dave's proposal 
> that suggests that the coercion/promotion rules  should be pushed out 
> of the actual operator semantics and placed into an extensible set of 
> methods.
>
> [1] 
> http://wiki.ecmascript.org/doku.php?id=strawman:operator_overloading_with_double_dispatch 
>
>
> Allen
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list