Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ffa8f2882d5b2a1ab0e0a80859bf9bd474986a20
Ticket: 1017884fffffffffffffffffffffffffffffffff
make 'level' arg to uplevel/upvar mandatory
User & Date: dvrsn on 2004-08-27 20:58:44
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    uplevel always converts its first argument into a
    string in order to check if it is the optional ?level?
    argument.  If the optional argument is not present, the
    first argument is converted anyway, which can take
    significant time and loses the benefit of direct list
    evaluation.  
    
    set l [list]
    for {set c 0} {$c < 10000} {incr c} {
        lappend l 12345
    }
    
    proc t1 {l} {
        set cmd [list llength $l]
        uplevel $cmd
    }
    
    proc t2 {l} {
        set cmd [list llength $l]
        uplevel 1 $cmd 
    }
    
    puts [time {t1 $l} 100]
    puts [time {t2 $l} 100]
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dvrsn"
  9. subsystem changed to: "22. [proc] and [uplevel]"
  10. title changed to: "uplevel can shimmer to string unnecessarily"
  11. type changed to: "RFE"