Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 26a3861de3e7559e67d6e1adec59262a8cd4fb38
Ticket: 1755984fffffffffffffffffffffffffffffffff
trace documentation is confusing
User & Date: legolas_a20 on 2007-07-18 09:42:08
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    See discussion here:
    http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/e0a7179c3c55bab5/2ea134e0b6662b9b?hl=en#2ea134e0b6662b9b
    
    This part of the documentation of 'trace' is confusing because it uses the word 'command' in several different meanings, in adjacent sentences. From the current text about trace, with pieces *marked*:
    
    --------------------------
    trace add execution name ops *command*
    
    Arrange for *command* to be executed whenever *command* name is executed
    [..]
    
    enterstep
    
    Invoke *command* for every Tcl *command* which is executed inside the
    *procedure* name, just before the actual execution takes place. For
    example if we have 'proc foo {} { puts "hello" }', then an enterstep
    trace would be invoked just before puts "hello" is executed. Setting
    an enterstep trace on a *command* will not result in an error and is
    simply ignored.
    
    leavestep
    
    Invoke *command* for every Tcl *command* which is executed inside the
    procedure name, just after the actual execution takes place. Setting
    a leavestep trace on a *command* will not result in an error and is
    simply ignored. 
    -------------------------
    
    I propose changing it to something along these lines:
    
    trace add execution name ops *script*
    
    Arrange for *script* to be executed whenever *command* name is executed[..]
    
    Invoke *script* for every Tcl *command* [..]
    
    Setting an enterstep trace on a *command that is not a proc ("Tcl Build-
    In commands" or a command provided by a compiled extension)* will not [..] 
    
    
    - Changing the first 'command' to script will reduce the uses of command in a different meaning from 4 to 3.
    - The last use of command needs some form of qualification, since without it, the text basically says: "Run script whenever a command x is executed. It is ok to pass a command as x." and that seems to say the same thing twice.
    - I still think having the overall text talk about the 'command name', then having the details like for enterstep talk about the 'procedure name' is confusing, however I cannot suggest anything better as I (now) understand that for enter and leave it really is any command, while for enterstep and leavestep it is only useful if command is a procedure.
    
  4. foundin changed to: "obsolete: 8.4.14"
  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: "legolas_a20"
  10. subsystem changed to: "69. Other"
  11. title changed to: "trace documentation is confusing"
  12. type changed to: "Bug"