On Thu, 26 Sep 2002, Sean O'Rourke wrote:
> Different operators doing different things sounds awful to me, because it
> makes it hard to predict what will happen, because new operators will have
> to be able to control what they do with their operands, and because new
> types of "array-like" operands will have to tell operators how to treat
> them.  Blech.
> 
> Maybe treating lazy and/or infinite data structures as "infinitely short"
> for this purpose would capture most of what we mean, so hype(A,B) would
> take the longer of two finite lengths, the "more finite" of a finite and
> an infinite length, and infiniti for two infinite operands.

Sounds reasonable.

> Of course, this still doesn't account for what kind of extension makes
> most sense for a given operand/operator pair.  It seems to me that
> anything more complex than "undef" (which is consistent with out-of-bounds
> array accesses) would be a nightmare to get right.

We should respect default values if arrays can declare them.

Perhaps there will be a modifier for operator declarations to declare what 
the default behavior should be.  Otherwise I don't know how different 
behaviors for different operators would be possible, especially for 
user-defined operators.
   sub operator:foo is hyper_default(1) ...
I agree with "Blech", but we can procrasticate doing it at least until
Damian makes it clear how operators will define their behavior.

Otherwise, a contextualized undef (0 in numeric context, '' in string) 
would seem DWIM to me.  

I wouldn't want to throw tons of warnings from one operation, so maybe 
hyper-operating on unequal lengths gets a new warning, instead of throwing 
lots of 'undefined value' warnings.

~ John Williams

Reply via email to