Chaim Frenkel wrote:
> >>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
> DS> To do it generally opens a huge can of worms. Doing it in a limited number
> DS> of cases (int->BigInt, float->BigRat, char->UTF8) is more reasonable, and
> DS> we can certainly manage that.
> 
> Why limited? Doesn't this problem effect all pairwise combinations of
> operators?

Yes, but it has to be limited because there are an infinite number of
possible conversions between types. We either follow strict rules about
which type gets to handle the operations, or we have flexible rules for
a strict subset of the possible types.

I think Dan is proposing that we have flexible rules, but if those fail
then we fallback on the strict ones. Unfortunately, this may not be
predictable for the user -- it's kind of a DWIM feature and those have a
nasty habit of turning into surprises if the system can't figure out what
you mean.

Smalltalk and Self have strict rules -- they always run the method on
the left hand object. C++ has less strict rules -- it always looks for a
method that fits the type signature even if type conversion is required.

I think Smalltalk is a *lot* more predictable than C++, but C++ does
what you want more often.

- Ken

Reply via email to