On Sat, Jan 08, 2005 at 11:37:06AM -0700, Craig DeForest wrote:
: I just re-read Synopsis 9, which covers PDL-related actions and array 
slicing, 
: and came to the conclusion that either (A) there's a hole in the syntax as it 
: is lain out,  (B) I lack sufficient understanding of what has been thought 
: out so far, or (C) that part of the language definition isn't finished yet.

I expect C is closest to the mark.  :-)

: Is the perl6 expression
:       @a[4; 0..5];
: a 1x6 array (probably correct)?  Or a 6 array (probably not correct)?

Certainly the former.  I don't think dimensions should ever disappear
accidentally.

: If the former, how do you specify that you want the latter?

I don't know offhand.  I see both the lure and the danger of the
extra parens, so we'll probably not go that route.  We could find
some keyword that destroys the current dimension while supplying a
scalar argument:

    @a[gone(4); 0..5];

Or maybe we want some notation that is explicitly a null slice with
a scalar value, maybe something like:

    @a[() but 4; 0..5];

or

    @a[():pick(4); 0..5];

or

    @a[4 but dim(); 0..5];

or maybe even something strange like:

    @a[()=4; 0..5];

But I'm certainly open to other suggestions.

Larry

Reply via email to