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.


Reply via email to