Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 77726319868b0580299318a7fef7f3f293351648
Ticket: 2390819fffffffffffffffffffffffffffffffff
[catch] leave trace mystery
User & Date: dgp on 2008-12-04 22:07:45
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    
    
    % proc foo1 {} {
    catch {return -code error zoom} err
    return [list $err zam]
    }
    % proc foo2 {} {
    catch {
    return -code error zoom
    } err
    return [list $err zam]
    }
    
    [foo1] and [foo2] are the same except
    for whitespace, and as expected, they
    produce the same results:
    
    % foo1
    zoom zam
    % foo2
    zoom zam
    
    Next create same routines again, with
    new names, bar1 and bar2:
    
    % proc bar1 {} {
    catch {return -code error zoom} err
    return [list $err zam]
    }
    % proc bar2 {} {
    catch {
    return -code error zoom
    } err
    return [list $err zam]
    }
    
    This time, before compiling and running,
    add a leave trace on [catch] :
    
    % trace add execution catch leave {puts zing! ;#}
    
    and try again:
    
    % bar1
    zing!
    zoom zam
    % bar2
    zing!
    zoom
    
    
    WTF?!?!?
    
    
  4. foundin changed to: "obsolete: 8.4.19"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dgp"
  10. subsystem changed to: "46. Traces"
  11. title changed to: "[catch] leave trace mystery"
  12. type changed to: "Bug"