Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6e533f6d47aed6c171a0a6c9ef67b2a8c6e04aaf
Ticket: 2055782fffffffffffffffffffffffffffffffff
Crash in [namespace inscope]
User & Date: lars_h on 2008-08-17 11:37:10
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Calling [namespace inscope] with an empty script argument crashes Tcl 8.5 (both .0 and .4 tested), but appears to work in previous versions (two 8.4 and one 8.3 tested).
    
    Compare
    
    % info pa
    8.5.4
    % namespace inscope tcl {} HistInfo
    alloc: invalid block: 0xebc70: 0 2
    Abort
    [hexley:Tcl/build/tcl] lars% uname -a
    Darwin hexley.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc
    
    to
    
    % info pa
    8.4.16
    % namespace inscope tcl {} HistInfo
         1  info pa
         2  namespace inscope tcl {} HistInfo
    % 
    
    Why would anyone want to do this, then? It turns out that
    
    interp alias {} ::foo {} namespace inscope ::foo ""
    
    is a fairly good emulation of
    
    namespace eval ::foo {
       namespace export *
       namespace ensemble create
    }
    
    which works also in older Tcl versions.
    (The emulation can be further improved by using an auxiliary interpreter, but that's probably more trouble than it's worth.)
    
  4. foundin changed to: "obsolete: 8.5.4"
  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: "lars_h"
  10. subsystem changed to: "21. [namespace]"
  11. title changed to: "Crash in [namespace inscope]"
  12. type changed to: "Bug"