>  (a === b) >= (new Symbol(a) === new Symbol(b))

Not sure I follow... so, I either I don't agree or I don't understand :).
 I'm having to dig deep to remember my math vocab here, but I think it may
be most correct to say that the Symbol constructor, when passed an
argument, should be injective [1].  That is,

1. let *F* = *new Symbol*
2. if <http://en.wikipedia.org/wiki/Material_conditional> *a* = *b*, then *F
*(*a**)* = *F(b)*
3. if *a* != *b*, then *F(a) *!= *F(b)*

> In any case, I'd also say that weak maps are good enough for your use
case.

In some (most?) cases, but not all.  There's already a consensus that the
garbage collection semantics of WeakMaps aren't always appropriate [2].  By
parameterizing the Symbol constructor, developers can create custom map/set
types without the overhead of a "Symbol Factory" (as previously suggested
by Allen).  I believe this would be a useful building block for interesting
and innovative custom types.

[1]: https://en.wikipedia.org/wiki/Injective_function#Definition
[2]: http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets

On Mon, Jul 15, 2013 at 5:52 AM, Andreas Rossberg <[email protected]>wrote:

> On 12 July 2013 22:29, Jeremy Martin <[email protected]> wrote:
> > My expectation would be that...
> >
> > (a === b) === (new Symbol(a) === new Symbol(b))
>
> Nit: you probably either mean
>
>   (a === b) >= (new Symbol(a) === new Symbol(b))
>
> or
>
>   (Object.is(a, b)) === (new Symbol(a) === new Symbol(b))
>
> In any case, I'd also say that weak maps are good enough for your use case.
>
> /Andreas
>



-- 
Jeremy Martin
661.312.3853
http://devsmash.com
@jmar777
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to