> I'm not sure the exact Perl 5 internal rep., but right now 'use
> overload' already allows individual overloading of all the numeric and
> string equality functions individually:
> 
>     o Comparison operations
>          "<",  "<=", ">",  ">=", "==", "!=", "<=>",
>          "lt", "le", "gt", "ge", "eq", "ne", "cmp",
> 
>       If the corresponding "spaceship" variant is available,
>       it can be used to substitute for the missing operation.
>       During "sort"ing arrays, "cmp" is used to compare
>       values subject to "use overload".
> 
> It looks like Branden took the vtable names from RFC 159, which is a
> modification of 'use overload' ops to object member functions. During
> our discussions of this on -objects, I remember Damian emphasizing that
> you want as much granularity as possible with anything that's overloaded
> (especially concerning the ability to overload || and &&).

Maybe.  I agree on the || and &&, I want them be overloadable, too,
but what does that have to do with comparison operators?  My poor
brain just doesn't see the utility of being able to separately
overload lt and le.  <pinching>   Ahhh, okay, for example some
funky datatype where < and <= have to have the *same* semantics.
Awwwwright.

One additional datapoint to overload your brain with is to consider
the ambiguity of equality and comparison.  Unicode normalization:
is A + grave equal to Agrave?  Is Agrave less than Aacute? Unicode
collation combined with language/locale-specific rules. 

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Reply via email to