Re: Anonymous multidimensional array

2009-06-02 Thread yary
On Mon, Jun 1, 2009 at 10:43 PM, John M. Dlugosz And it should be an error if dimensions other than the highest are unspecified.  How can it know how to shape it?  Use an explicit command to shape up the argument in that case. I don't see why shape(2;*) is not a problem and shape(*;2) is a

Re: Anonymous multidimensional array

2009-06-02 Thread Larry Wall
On Tue, Jun 02, 2009 at 08:21:29AM -0700, yary wrote: : I do see a problem if there's more than one unspecified dimension. : Though I suppose an array of shape(*;*) as an lvalue might be a : constraint allowing assignment only of another 2D array? I don't see why we shouldn't use the capture

Re: Anonymous multidimensional array

2009-06-02 Thread yary
I haven't gotten deep into the shape/array specs and I need to... nonetheless On Tue, Jun 2, 2009 at 9:55 AM, Larry Wall la...@wall.org wrote: I don't see why we shouldn't use the capture shape of the value by default all the time, and do linear reshaping only if the value comes in as a flat

Re: Anonymous multidimensional array

2009-06-02 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Tue, Jun 02, 2009 at 08:21:29AM -0700, yary wrote: : I do see a problem if there's more than one unspecified dimension. : Though I suppose an array of shape(*;*) as an lvalue might be a : constraint allowing assignment only of another 2D array? I

Anonymous multidimensional array

2009-06-01 Thread yary
How does one create an anonymous multidimensional array in p6? Not an array of arrays or a capture of captures... I'm guessing it involves Array.new(:shape) or something like words go in here:shape(2;2), and that it's not yet implemented in Rakudo. Is anonymous multidimensional array creation

Re: Anonymous multidimensional array

2009-06-01 Thread Larry Wall
On Mon, Jun 01, 2009 at 08:23:41PM -0700, yary wrote: : How does one create an anonymous multidimensional array in p6? Not an : array of arrays or a capture of captures... But I would expect a shaped array to be able to coerce either of those into its internal format. And coercing captures

Re: Anonymous multidimensional array

2009-06-01 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Mon, Jun 01, 2009 at 08:23:41PM -0700, yary wrote: : How does one create an anonymous multidimensional array in p6? Not an : array of arrays or a capture of captures... But I would expect a shaped array to be able to coerce either of those