On Thu, 26 Sep 2002, Paul Johnson wrote:

> On Thu, Sep 26, 2002 at 07:03:10AM -0700, Sean O'Rourke wrote:
> 
> > On Thu, 26 Sep 2002 [EMAIL PROTECTED] wrote:
> > 
> > > Hi folks!
> > >
> > > I did some tests with the new for loop and don't understand some of
> > > the results. Perhaps this is just due to some warts in the
> > > implementation at the moment.
> > 
> > Yes.  I personally think it makes more sense, in a language that allows
> > infinite and/or lazy lists, to use the length of the shorter of the two
> > streams, so that's what I did.  When I implemented this, I had forgotten
> > the Apocalypse passage mandating the other behavior.  You're welcome to
> > change it if you want ;).
> 
> If I recall correctly, which I probably don't, there was a question at
> YAPC::Europe (or maybe it was the Perl 6 Mini::Conference) as to what
> the shorter array would return.  The answer, from Larry or Damian, was
> that it might return undef or maybe it would keep returning its last
> value.

Exegesis 3 says:

"This works for all unary and binary operators, including those that are
user-defined. If the two arguments are of different lengths, the operator
Does What You Mean (which, depending on the operator, might involve
padding with ones, zeroes or undef's, or throwing an exception)."

~ John Williams


Reply via email to