Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-29 Thread Karl Glazebrook
Yes that is a good point, which I had forgotten about in my concern over syntax. Some guidance is needed about what the default passing is likely to be in perl6. Will (@x,@y) = mysub @a, @b implicitly pass by reference? Karl Christian Soeller wrote: > In summary, I doubt that having PDLs b

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-28 Thread Christian Soeller
Karl Glazebrook wrote: > > Consider > > @x[10:20, 20:40:2, 30:50] > > This ALMOST works in the current Perl. @x gives array context, > then the , produces a list. I see a number of problems with the current (scalar) PDL objects being turned (essentially) into perl arrays in perl6. 1) How do y

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-28 Thread Karl Glazebrook
Consider @x[10:20, 20:40:2, 30:50] This ALMOST works in the current Perl. @x gives array context, then the , produces a list. If [] is overloaded on @a then the subroutine sees a list like "10:20", "20:40:2", "30:50" The only reason it does NOT work in the current perl is that "10:20" is a s

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-26 Thread Daniel Chetlin
On Fri, Aug 25, 2000 at 07:35:24PM -0700, Nathan Wiger wrote: > > > > $a[$i][$j][$k] or $a[$i,$j,$k] > > > The second one has no useful meeting, "," is just an operator which > > does nothing much useful in this context. > > Not true, at least not in the Perl I know. :-) Here's a description of >

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-26 Thread Ariel Scolnicov
Nathan Wiger <[EMAIL PROTECTED]> writes: > > > > $a[$i][$j][$k] or $a[$i,$j,$k] > > > The second one has no useful meeting, "," is just an operator which > > does nothing much useful in this context. > > Not true, at least not in the Perl I know. :-) Here's a description of > what these do in P

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-25 Thread Nathan Wiger
> > > $a[$i][$j][$k] or $a[$i,$j,$k] > The second one has no useful meeting, "," is just an operator which > does nothing much useful in this context. Not true, at least not in the Perl I know. :-) Here's a description of what these do in Perl just to clarify: $a[0][1][2]; # get a singl

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-25 Thread Nathan Torkington
David L. Nicol writes: > Looks like if we give the data type control over what > the meaning of square brackets after it is, the rest > becomes example code. I think this s covered in the > horribly misnamed http://dev.perl.org/rfc/115.pod which > covers overloading bracketing. The big problem w

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-25 Thread c . soeller
"David L. Nicol" wrote: > > Looks like if we give the data type control over what > the meaning of square brackets after it is, the rest > becomes example code. I think this s covered in the > horribly misnamed http://dev.perl.org/rfc/115.pod which > covers overloading bracketing. Agreed. We sh

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-25 Thread David L. Nicol
Looks like if we give the data type control over what the meaning of square brackets after it is, the rest becomes example code. I think this s covered in the horribly misnamed http://dev.perl.org/rfc/115.pod which covers overloading bracketing. @reshaped = reshape $x, $y, $i, @array [,

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-25 Thread Karl Glazebrook
Nathan Wiger wrote: > > > OK here is a basic question: how do we specify element access in > > PDL type arrays? > > > > $a[$i][$j][$k] or $a[$i,$j,$k] > > Both of these already have firm meaning in Perl. The second one is used > to bite off selected elements of an array. So if you want a differe

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-24 Thread Nathan Wiger
> OK here is a basic question: how do we specify element access in > PDL type arrays? > > $a[$i][$j][$k] or $a[$i,$j,$k] Both of these already have firm meaning in Perl. The second one is used to bite off selected elements of an array. So if you want a different syntax you'll have to use some ot

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-24 Thread Karl Glazebrook
There is already a reshape() in PDL. Obviously that only applies to PDL arrays. But if PDL style arrays get in to the core, then that sort of functionality ought to arise. OK here is a basic question: how do we specify element access in PDL type arrays? $a[$i][$j][$k] or $a[$i,$j,$k] Most nu

RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

2000-08-24 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Add reshape() for multi-dimensional array reshaping =head1 VERSION Maintainer: Nathan Wiger <[EMAIL PROTECTED]> Date: 24 Aug 2000 Version: 1 Mailing List: [EMAIL PROTECTED] Number: 148 Sta