develooper Front page | perl.perl6.language.data | Postings from September 2000

Re: RFC 82 (v3) Arrays: Apply operators element-wise in a list context

Thread Previous
From:
Jeremy Howard
Date:
September 9, 2000 14:26
Subject:
Re: RFC 82 (v3) Arrays: Apply operators element-wise in a list context
Message ID:
001701c01aa2$cf1d1e30$d5252ccb@optimaldecisions.com
Nathan Wiger wrote:
> The only thing that *really* makes me nervous about the RFC is this
> part:
>
> > >   @d = @b * @c;   # Returns (2,8,18)
> > >
> > > If the lists are not of equal length, an error is raised.
>
> I really don't like the "error is raised" part, at least not by default.
> Maybe "use strict 'ops'" could turn this on. I think by default arrays
> should DWIM in this context, whether it be auto-padding with undef's,
> 1's, or whatever we decide.

This bit has changed in the last version. Previous versions specified that
the smaller arrays should act as if they were the same size as the larger,
but were padded with undefs (but no actual autovivification would occur on
the array itself).

Maybe if ':bounds' (RFC 203) is set on both arrays, then the exception
behaviour occurs, otherwise the implicit padding occurs...



Thread Previous


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