Karl Glazebrook wrote: > This also addresses one pain in current PDL which is the > difficulty of multi-dim indexing. I like it, too ;) > > print $a[[0,0,0]]; # literal ref list > > print $a[0;0;0]; # literal singleton ; list > > print $a[[$y,$y,$y]]; # variable-based ref list > > print $a[$y;$y;$y]; # variable-based singleton ; list > > print $a[[@lorigin]]; # ref to copy of array variable > > print $a[\@lorigin]; # ref of array variable > > print $a[$rorigin]; # ref variable > > print $a[diagonal(0)];# function that returns array ref > > > > There... 8 ways to do it... > > Do we really need 8 ways? No, at least 18. One more piece of semantics that would be appreciated is optional omission of trailing dimensions in slices, e.g. for a 3-dim @a: @a[0:1] == @a[0:1;] == @a[0:1;;] Christian
- Re: a syntax derived from constant-time... Nathan Wiger
- Re: a syntax derived from constant-time... David L. Nicol
- Re: a syntax derived from constant-time... Nathan Wiger
- Re: a syntax derived from constant-time... David L. Nicol
- Re: a syntax derived from constant-time... Karl Glazebrook
- Re: a syntax derived from constant-time... c . soeller
- Re: n-dim matrices Karl Glazebrook
- Re: n-dim matrices Buddha Buck
- Re: n-dim matrices Karl Glazebrook
- Re: n-dim matrices Buddha Buck
- Re: n-dim matrices Christian Soeller
- Re: n-dim matrices Buddha Buck
- Re: n-dim matrices Christian Soeller
- Re: n-dim matrices Karl Glazebrook
- Re: n-dim matrices David L. Nicol
- Re: n-dim matrices Jeremy Howard
- Re: n-dim matrices Christian Soeller
- Re: n-dim matrices Karl Glazebrook
- Re: n-dim matrices Jeremy Howard
- Re: n-dim matrices Buddha Buck
- Re: n-dim matrices Christian Soeller