Ticket #25 (closed enhancement: wontfix)
Provide support for negative indexes as end relative offsets
Reported by: | hopscc | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
Discussion at
Negative indexes as end offsets
Provide an extended indexing construct [[ ]] analogous to [ ]
Extended indexes support both positive and negative indices.
Positive indexes are as for [] indexing.
Negative indexes are treated as relative to the end of the collection with
coll[[-1]]
accessing the last item of the collection coll.
Dont affect performance of [] indexing.
Both positive and negative indexes off the edges of the collection throw an exception as per [] indexing.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.