Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e24514dcd00c4344eeff35199f809eeeba1d17a7
Ticket: 420507ffffffffffffffffffffffffffffffffff
Inconsistent behaviour of [unknown]
User & Date: msofer on 2001-05-01 18:03:56
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    There is an inconsistency in the handling of [unknown]:
    the bytecode engine always calls the global [unknown],
    the direct eval engine calls [unknown] in the local
    namespace. The following illustrates the bug:
    
    % info patchlevel
    8.4a2
    % namespace eval mig {set l aaa}
    aaa
    % proc unknown args {puts global}
    % proc mig::unknown args {puts local}
    % namespace eval mig {$l}
    global
    % namespace eval mig {eval $l}
    local
    
    It is quite straightforward to patch the source to
    obtain a consistent behaviour. The patch will be either
    in generic/tclExecute.c (to get the bytecode compiler
    to call the namespace [unknown]), or else in
    generic/tclParse.c.
    
    I do not know which of the two behaviours is the
    correct one! The man page for 'unknown' does not
    resolve the issue. OTOH, the behaviour was consistent
    in 8.0.5 (always call [::unknown]):
    
    % info patchlevel
    8.0.5
    % namespace eval mig {set l aaa}
    aaa
    % proc unknown args {puts global}
    % proc mig::unknown args {puts local}
    %  namespace eval mig {$l}
    global
    % namespace eval mig {eval $l}
    global
    
    I have not tested other versions.
    
    
  4. foundin changed to: "None"
  5. priority changed to: "7 High"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "msofer"
  9. subsystem changed to: "45. Parsing and Eval"
  10. title changed to: "Inconsistent behaviour of [unknown]"
  11. type changed to: "Bug"