Re: TIP #176: Add String Index Values
From: Andreas Leitgeb (avl_at_gamma.logic.tuwien.ac.at)
Date: 03/29/04
- Next message: Iain B. Findleton: "Curiosity about assignment"
- Previous message: Arjen Markus: "Re: Ai Wiki for Tcl"
- In reply to: David S. Cargo: "Re: TIP #176: Add String Index Values"
- Next in thread: Jonathan Bromley: "Re: TIP #176: Add String Index Values"
- Reply: Jonathan Bromley: "Re: TIP #176: Add String Index Values"
- Reply: David S. Cargo: "Re: TIP #176: Add String Index Values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Mar 2004 13:43:26 GMT
David S Cargo <escargo@skypoint.com> wrote:
>>The existing syntax is clumsy, though. It would be better to deprecate
>>"end" and use negative offsets to index from the end of the list. It
>>would make a lot of code cleaner.
> This is the way that access to lists and strings is done in Icon (and
> Unicon). Nonnegative numbers access from the start; negative numbers
> access from the end.
So, take [linsert $list $index foo]
What value of $index would cause "foo" being appended to $list ?
(currently, "end" does it, while "end-1" would insert it
just before the last element)
Do I understand correctly, that end-N generally would become -(N+1)
(for any nonnegative N) to get to the same position?
- Next message: Iain B. Findleton: "Curiosity about assignment"
- Previous message: Arjen Markus: "Re: Ai Wiki for Tcl"
- In reply to: David S. Cargo: "Re: TIP #176: Add String Index Values"
- Next in thread: Jonathan Bromley: "Re: TIP #176: Add String Index Values"
- Reply: Jonathan Bromley: "Re: TIP #176: Add String Index Values"
- Reply: David S. Cargo: "Re: TIP #176: Add String Index Values"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|