Ticket #25 (closed enhancement: wontfix)

Opened 6 months ago

Last modified 6 months 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 (19.9 kB) - added by hopscc 6 months ago.
extended Index patch with fixed line endings

Change History

Changed 6 months ago by hopscc

extended Index patch with fixed line endings

Changed 6 months 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.