Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1a99b345e0eb982a1691b859038c206f5d620615
Ticket: 1052584fffffffffffffffffffffffffffffffff
TIP#225: O(1) space [range] command.
User & Date: antirez on 2004-10-23 01:22:33
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    That's a first version of the [range] command
    working in O(1) space. There is some minor bug I'll fix
    tomorrow, but the basic stuff appears to be ok.
    
    commands aware of the new arithSeries object
    in the TEBC and normal fashion:
    
    llength
    lindex
    foreach
    
    New commands:
    
    Only [range]. The change is minimal from
    the user point of view. From the core
    side is a bit more tricky because of the O(1)
    space aims.
    
    Other stuff optimized for this object:
    
    SetListObjFromAny will directly convert ranges
    into lists without to pass for the string repr.
    
    Open issues:
    
    The code needs a check in order to
    don't allow the generation of ranges
    that are longer than the max listObj length
    supported by the current Tcl code.
    
    For the rest, I used Wide Ints in order to
    ensure that ranges shorter than the max
    list length, but having as elements Wide ints
    will work.
    
    Performance changes:
    
    The effects on the performances of the list-oriented
    should be very small, there is some test more
    than before. 
    
    The case of:
    
    foreach x [range 0 $n]
    
    is faster than the
    equivalent [for] form by 10% to 30% from
    a first test.
    
    The appended patch should apply against HEAD.
    
  4. foundin changed to: "TIP Implementation"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "antirez"
  9. subsystem changed to: "14. List Object"
  10. title changed to: "O(1) space [range] command."
  11. type changed to: "Patch"