develooper Front page | perl.perl6.language | Postings from May 2001

RE: slices

Thread Previous | Thread Next
From:
David Whipp
Date:
May 25, 2001 13:44
Subject:
RE: slices
Message ID:
001101c0e55b$583496c0$926464c4@intranet.fastchip.com
Uri Guttman wrote:
> so we have to get some way to denote a list of indices as a slice and
> also support some range operation as a possible component of that list
> with the knowledge that the range arguments are also indices and not
> just integers.
> 
> i don't have any syntax ideas for this at the moment.

We already have the concept of contexts (list, scaler, bool, etc.). SO
we can start with the concept of "index context" (list-index context
for slices). In index context, we could define "*" as a special token
that returns the highest index.

Then, @a[(0..*)] would be the whole list; @a[(0..*-1)] is everything
but the last_elem. Any users of UML (or data modeling in general)
will likely find this notation comfortable.

Dave.

--
Dave Whipp, Senior Verification Engineer,
Fast-Chip inc., 950 Kifer Rd, Sunnyvale, CA. 94086
tel: 408 523 8071; http://www.fast-chip.com
Opinions my own; statements of fact may be in error. 


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About