Re: XML/HTML-specific ?< and ?> operators? (was Re: RFC 145 (alternate approach))
[email protected] (Bart Lateur) Thu, 07 Sep 2000 10:34:21 +0200
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Organization | MediaMind |
| Message-ID | <[email protected]> |
On 06 Sep 2000 18:04:18 -0700, Randal L. Schwartz wrote: >I think the -1 indexing for "end of array" came from there. Or at >least, it was in Perl long before it was in Python, and it was in Icon >before it was in Perl, so I had always presumed Larry had seen Icon. >Larry? Do not assume that these are the only languages that exist. There must be hundreds of languages; see the famous "Free Compilers" list (<http://www.idiom.com/free-compilers/>). At least a few of these do support -1 for last array index. p.s. Shall I bring up the "@array[2 .. -1] should do the proper thing" requested feature again? Oops, I just did. I think implementing this basically requires lazy evaluation of the (2 .. -1) thing, so when it eventually needs to be turned into a list of numbers, [a] it is aware of the fact that it's in an "list indexing context", and [b] it knows the number of list items. And yes, some of the other languages do properly support this feature. -- Bart.