On 3 April 2014 15:39, C. Scott Ananian <ecmascr...@cscott.net> wrote: > On Thu, Apr 3, 2014 at 9:09 AM, Andreas Rossberg <rossb...@google.com> wrote: >> On 3 April 2014 14:57, C. Scott Ananian <ecmascr...@cscott.net> wrote: >> Unfortunately, that only works for primitives because the respective >> constructor/wrapper class is known to exist in all realms, it is known >> to be "the same" everywhere, and because the language can hence apply >> some magic to "rebind" it when primitives cross realm boundaries. For >> user-defined values, no such guarantees exist. Hence, no similar >> rebinding magic can be applied, and values have to hold on to their >> original constructor. > > I'm waving my hands here, but it seems to me that a two-part solution > could work: > > [...]
Without going into details: Yes, it should be possible to build some form of registry mechanism (similarly as for symbols) that supports mapping and round trips of uvalues. However, that could be rather involved (maybe needing membranes?), and hence would best be an abstraction on top. I see no particular reason to build it into the core value type semantics -- we don't do anything like that for objects either. /Andreas _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss