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

Re: RFC 231 (v1) Data: Multi-dimensional arrays/hashes andslices

Thread Previous | Thread Next
From:
Jeremy Howard
Date:
September 21, 2000 14:43
Subject:
Re: RFC 231 (v1) Data: Multi-dimensional arrays/hashes andslices
Message ID:
001b01c02414$fae37390$0100a8c0@jeremy
Christian Soeller wrote:
> Karl Glazebrook wrote:
> > Buddha Buck wrote:
> > > >
> > > >   @x = 3 * $y[|i];
> > > >
> > > >It's not as clean as @x = 3 * @y, but it is cleaner context-wise.
> > >
> > > And one could argue that:
> > >
> > >     @x = map 3*^_, @y;
> > >
> > > is cleaner yet...
> >
> > PDL already allows $x = 3*$y
> >
> > why step backwards?
>
> Exactly. Those other solutions are plain ugly.
>
> Slightly different messages are conveyed in this regard anyway. Dan
> Sugalski wrote at some stage that overloading for arrays is a feature
> very likely to be in perl6 while Ilya says this will add to confusion.
> ?!
>
Yes, Dan and others have been involved from the start and have regularly
provided feedback on what is viable... But let's not second guess the
capabilities of the -internals guys. We should specify a good language
design that is conceptually viable. This means that our proposals should be
internally consistent, provide a simple and intuitive interface, and avoid
problems that Computer Science has not yet solved.

In the example of array operations, element-wise operations, including the
broadcasting of lower dimensionality arrays (and scalars) to to higher
dimensions, is one of the most powerful constructs in languages like NumPy
and J and is well proven as a powerful and viable approach. We can propose
the best semantics we can develop, which provides a platform for iteration
between design and implementation that has a clear goal. Compromises in
implementation are then also more clear.



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