develooper Front page | perl.perl6.internals | Postings from September 2002

RE: [netlabs #801] [PATCH] PerlArray in scalar context

Thread Previous | Thread Next
From:
Sean O'Rourke
Date:
September 4, 2002 17:20
Subject:
RE: [netlabs #801] [PATCH] PerlArray in scalar context
Message ID:
Pine.GSO.4.32.0209041710120.29829-100000@gradlab.ucsd.edu
On Wed, 4 Sep 2002, Brent Dax wrote:
> What if (say) @b is a two-dimensional array?

Then you get "interesting values of undef" :).  Seriously, I suspect one
of the following:

1 - runtime error
2 - each row (or column) of @b numified to its length
3 - the first element of each row/col of @b
4 - the other arrays boosted to the highest dimension

I like #2, because it is easy and keeps hyper-operation simple.  If those
aren't just numeric operators, but some other weird user-defined thing,
then an array as one operand makes sense.  The simpler hyping is, the
better, IMHO.  Some people doubtless like #4 because it's a natural
extension of the way scalars get auto-boosted to one-dimensional arrays.
As a middle ground, we could have

5 - use /\^<$n><operator>/ to do a nested $n-dimensional hype

Oh, yeah.

/s

who regrets opening his mouth...


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About