Larry Wall larry-at-wall.org |Perl 6| wrote:
On Sat, Jun 13, 2009 at 02:49:10PM -0500, John M. Dlugosz wrote:
Wow. The overarching logic for list assignment would have to compare
the containers and the arguments in the capture before doing the list
assignment to each container, in order t
On Sat, Jun 13, 2009 at 02:49:10PM -0500, John M. Dlugosz wrote:
> Wow. The overarching logic for list assignment would have to compare
> the containers and the arguments in the capture before doing the list
> assignment to each container, in order to avoid cloning all the
> containers on th
Daniel Carrera daniel.carrera-at-theingots.org |Perl 6| wrote:
In addition, the current @a.shift is useful because it returns the
element that was removed from the array, so you can do something with it:
The change to the library synopses was checked in before you posted
that, if I recall the
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote:
So, how do I deal with a multidim array? Well, TIMTOWTDI...
my @a = 1,[2,[3,4]];
say @a[1][1][1];
say @a[1;1;1]; # I'm not sure this is correct
I think that it should be. That is, multi-dim subscript is always the
same as chained subscrip
Larry Wall larry-at-wall.org |Perl 6| wrote:
Alternately, we leave @@ (or @%) meaning ¢ and instead let some
other syntax take over the "pay attention to the capture's structure"
semantics from @@. Maybe it's another use for the zen slice:
"pay attention to the capture's structure" is a c
Larry Wall larry-at-wall.org |Perl 6| wrote:
We also need to consider the "dimension" of referentiality. I can see
three levels here. Given
@a.mung
the .mung could return
A) a modified @a (treat @a as mutable)
B) a new array (treat @a as immutable)
C) a remapped array whose e
On Fri, Jun 12, 2009 at 11:23 PM, Matthew
Walton wrote:
> Although some things may be able to be implemented far more
> efficiently if they know that they're being called with infix:<.=> and
> not with infix:<.>.
Last I checked, Perl 6 had some types that are mutating and others
that aren't (e.g.,
Larry Wall wrote:
Nevertheless, for any major methods borrowed from Perl 6, I'm not
inclined to change them that drastically. Much more likely to
define them as sugar for the more general list operators:
.push means .=append
.unshiftmeans .=prepend
.splice means
On Sat, Jun 13, 2009 at 1:08 AM, Larry Wall wrote:
> Nevertheless, for any major methods borrowed from Perl 6, I'm not
> inclined to change them that drastically. Much more likely to
> define them as sugar for the more general list operators:
>
> .push means .=append
> .unshift me
On Sat, Jun 13, 2009 at 01:25:23AM +0200, Daniel Carrera wrote:
> Damian Conway wrote:
>> In fact, I would even be happy with requiring @a.=push and @a.=shift, if
>> it meant that there were *no* special cases. One extra character is a
>> small price to pay for perfect SWIM (and not just "Say What
Damian Conway wrote:
In fact, I would even be happy with requiring @a.=push and @a.=shift, if
it meant that there were *no* special cases. One extra character is a
small price to pay for perfect SWIM (and not just "Say What I Mean",
the real benefit is the other SWIM: "See What I Meant").
I don
Larry mused:
> �...@a.mung
>
> the .mung could return
>
> A) a modified @a (treat @a as mutable)
> B) a new array (treat @a as immutable)
> C) a remapped array whose elements refer back to @a's elements
>
> Currently .rotate is defined as A, but I could easily switch it to B,
I, for on
On Fri, Jun 12, 2009 at 04:00:10PM -0300, Daniel Ruoso wrote:
: Em Sex, 2009-06-12 às 11:52 -0700, Jon Lang escreveu:
: > On Fri, Jun 12, 2009 at 11:51 AM, Daniel Ruoso wrote:
: > > Ok, There's one thing that is not clear in the thread, which is when an
: > > array is multidimensional or not...
: >
We also need to consider the "dimension" of referentiality. I can see
three levels here. Given
@a.mung
the .mung could return
A) a modified @a (treat @a as mutable)
B) a new array (treat @a as immutable)
C) a remapped array whose elements refer back to @a's elements
Currently
Em Sex, 2009-06-12 às 11:52 -0700, Jon Lang escreveu:
> On Fri, Jun 12, 2009 at 11:51 AM, Daniel Ruoso wrote:
> > Ok, There's one thing that is not clear in the thread, which is when an
> > array is multidimensional or not...
> > For instance:
> > @a = (1, 2, 3; 4, 5, 6; 7, 8, 9);
> > Will produce
On Fri, Jun 12, 2009 at 11:51 AM, Daniel Ruoso wrote:
> Ok, There's one thing that is not clear in the thread, which is when an
> array is multidimensional or not...
>
> For instance:
>
> �...@a = (1, 2, 3; 4, 5, 6; 7, 8, 9);
>
> Will produce a flatten array, because list assignment causes flatteni
Ok, There's one thing that is not clear in the thread, which is when an
array is multidimensional or not...
For instance:
@a = (1, 2, 3; 4, 5, 6; 7, 8, 9);
Will produce a flatten array, because list assignment causes flattening,
so the dimensionality was lost.
It is important to remember that
On Fri, Jun 12, 2009 at 10:58 AM, yary wrote:
>> * you can rearrange the dimensions themselves (e.g., transpose).
>
> Reflecting on 2 or more axes creates a transposition.
No, it doesn't:
@a = (1, 2, 3; 4, 5, 6; 7, 8, 9);
Reflecting on two axes would result in:
@a = (9, 8, 7; 6, 5, 4; 3
I think any 1D op could be transformed to "do the right thing" on a
multidimensional array, with some sort or hyperop or reduction
transform. Rotate, reverse, even add/subtract can be told "do your
thing along this vector" and return a usefully dimensioned result.
Need to work on other things at t
19 matches
Mail list logo