TSa (Thomas Sandlaß) wrote:
... unless you want C<when True> to do a value-and-type check,
in which case it doesn't exactly follow the pattern for smartmatching
of the other builtin types (which only check value equivalence,
not type equivalence).

This is true only if you want to distinguish 1 and True which are the
same value. But 42 should be distinct from this. Same goes for "viaduct".
So these three should be a valid disjoint set of choices that can be
made given $something.

Is that so? 1 and True *are* the same value now? Not Bool wraps Int rather than being a subset type and it and has wholly distinct values?

Carl Mäsak wrote:
> I don't know whence you got the impression that Bool is a subtype.
> Bool is an enumeration type, which makes True and False distinct
> objects both of which aren't (but instead wrap) their corresponding
> Int values.
>> Asking "False eqv 0" should be false, though either "False eqv ?0" or
>> "+False eqv 0" being true is okay.
> All those are as you want them.

I would like for what Carl said to be true, but TSa seems to be contradicting 

1 and True should *not* be the same value, and they should be distinguishable in any generic context like eqv or given-when. They should only compare alike when cast into the same type such as with a ? or +.

-- Darren Duncan

Reply via email to