Wiki

Ticket #25 (closed enhancement: wontfix)

Opened 16 years ago

Last modified 16 years ago

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

extIndexing.patch Download (19.9 KB) - added by hopscc 16 years ago.
extended Index patch with fixed line endings

Change History

Changed 16 years ago by hopscc

extended Index patch with fixed line endings

Changed 16 years ago by Chuck

  • status changed from new to closed
  • resolution set to wontfix

As discussed in the forum, I don't like the

Error: Failed to load processor i
No macro or processor named 'i' found

syntax. My current plan is still .last and .at.

Note: See TracTickets for help on using tickets.