Re: Enhancing array indices

2007-01-31 Thread TSa
HaloO Larry Wall wrote: But maybe you meant @x[*+2 .. *-1]? And @x[*] would be @x[*+0..^*-0] written out that way. How far can we drive the dwimmy use of the three values that determine array access, i.e first and last index and length. E.g. would @x[*+0..*/2] roughly slice to the

Re: Enhancing array indices

2007-01-31 Thread TSa
HaloO, I wrote: E.g. would @x[*+0..*/2] roughly slice to the middle of the array? Hmm, this might not work. It should be @x[*+0..*-1-*/2] on the footing that the last * is dwiming the length. This implies that dispatches to infix:-:(Whatever, Whatever) and infix/:(Whatever,Int) are supported

Enhancing array indices

2007-01-30 Thread Jonathan Lang
Could we get a single-character symbol that could be used in an array index to refer to its shape in a dwimmy way? Something like: @x[*.head] @x[*.tail] # equivalent to @x[*] @A[*.head+2, *.tail-1] (where head and tail are methods of the shape that return the current dimension's start and

Re: Enhancing array indices

2007-01-30 Thread Larry Wall
On Tue, Jan 30, 2007 at 02:54:26PM -0800, Jonathan Lang wrote: : Could we get a single-character symbol that could be used in an array : index to refer to its shape in a dwimmy way? Something like: : : @x[*.head] : @x[*.tail] # equivalent to @x[*] : @A[*.head+2, *.tail-1] : : (where head and

Re: Enhancing array indices

2007-01-30 Thread Larry Wall
On Tue, Jan 30, 2007 at 03:47:34PM -0800, Larry Wall wrote: : This mornings up date proposed Now the da rn spam fi1ters are chang.ng my spelling to look like sp*m. Yeah, that's the 4icket... :) Larry

Re: Enhancing array indices

2007-01-30 Thread Darren Duncan
At 12:11 PM -0800 1/30/07, [EMAIL PROTECTED] wrote: Log: Disabled negative subscript dwimmery for all shaped arrays. * can now take + and - operators. At 2:54 PM -0800 1/30/07, Jonathan Lang wrote: Could we get a single-character symbol that could be used in an array index to refer to its

Re: Enhancing array indices

2007-01-30 Thread Jonathan Lang
Larry Wall wrote: And @x[*] would be @x[*+0..^*-0] written out that way. Or possibly @x[-* ..^ +*] depending on how we define the unaries. Hmm... how about this: Normally, * in the context of an indexer acts as a Range object, covering the range of available indices (defined