On 5 Jul 2003, Luke Palmer wrote:
> > return [EMAIL PROTECTED] $begin .. $end ];
>
> I fear that this might take a reference to each element in the slice,
> rather than a reference to the slice....
Yes, that would indeed return a list of refs in perl5. Can it also be
assumed that the magic hyper-operation of \() in perl5 will translated to
perl6, or (hopefully) will this behaviour become more explicit with
something like ^\() (is the carat still the hyper-operator character
btw?) ?
> Actually, you can't reference a slice! Where the heck does the
> reference point?
Maybe this is a poor simile since references aren't pointers, but I would
imagine if references to slices were to exist they'd be something *like*
a pointer to a specific index in an array in C e.g
#include <stdio.h>
int main(void) {
char *str = "a list of characters";
char *p = &str[2];
puts(p);
return 0;
}
__output__
list of characters
Of course this isn't directly orthogonal to a reference of an array slice
but hopefully it illustrates my point. Or perhaps this could all just be
simply implemented with a tie() or some other such magic. Just thinking
out loud here :)
Dan Brook