On Tue, Jan 14, 2014 at 5:44 PM, Brendan Eich <[email protected]> wrote:

> Kevin Smith wrote:
>
>> I'll stop there, because I don't know the details of the proposal.
>>
>
> Allowing value objects (and perhaps mutable object) to define operators
> means giving up some invariants, similar to proxies which can have
> incoherent has/get etc.
>
> So I'm not sure what you are waiting for. A badly written user-defined
> value object? Those may be easy to cough up in order to complain about
> extensibility, but the whole point of value objects is to avoid hardcoding.
>
> If you want an int64 spec/impl to evaluate, that'll take a bit longer.
> Preview:
>
> js> 0L == 0
> true
> js> 0L === 0
> false
> js> typeof 0L
> "int64"
> js> 0UL == 0
> true
> js> 0UL === 0
> false
> js> 0UL == 0L
> true
> js> 0UL === 0L
> false
> js> typeof 0UL
> "uint64"
>

What about:

    0L == "0"

How is "===" defined for user-defined value types?  In terms of the T == T
overload?

    value class x {
        x == x () { ... }
    }
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to