Re: RFC 177 (v1) A Natural Syntax Extension For ChainedReferences
[email protected] ("David L. Nicol") Thu, 31 Aug 2000 20:36:44 +0000
| Newsgroups | perl.perl6.language,perl.perl6.language.data |
|---|---|
| Organization | University of Missouri - Kansas City supercomputing infrastructure |
| Message-ID | <[email protected]> |
Peter Scott wrote:
>
> >Having the
> >indices in one place saves a lot of characters. Compare
> >
> > $r->{{qw(a b c d e f g h)}}
> >
> >versus
> >
> > $r->{a}->{b}->{c}->{d}->{e}->{f}->{g}->{h}
>
> But I would compare it to
>
> $r->{a}{b}{c}{d}{e}{f}{g}{h}
>
> which is only one character longer than the proposal...
$r->{a..h}
(if we drop counting array elements inside container lookup braces)
in p5 the above resolves to $r->{8} no, it's $r->{@{\(a..h)}} because
of the context-based overloading of dotdot -- so to make $$r{a..h}
work we would need to both allow an array in container resolution brackets
to mean sequential access but also make that an array context. But
using dot-dot in there is awfully contrived.
--
David Nicol 816.235.1187 [email protected]
"My baby done left me,
she done went to the drive-in movies with somebody else."