Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f5c7adc82bd1b7e96e904c37524f4361a239fc72
Ticket: 1251123fffffffffffffffffffffffffffffffff
Variable resolution behaviour and documentation
User & Date: oox on 2005-08-03 23:59:26
Changes

  1. icomment:
    Logged In: YES 
    user_id=662619
    
    I've seen bug 959052: whow!
    
    >
    > Do you have a concrete proposal for 
    > that explanatory sentence? 
    >
    I knew you were going to ask that one!  :-)
    
    Given the fact that [variable] "behaves properly", I concede 
    that writing such a sentence is difficult.
    
    In fact the current behaviour for variables is consistent with 
    the documentation: if the variable does not exist in the 
    current namespace, Tcl scans the global namespace: if it 
    does exist there, then Tcl resolves to that. The problem, as I 
    see it, is that [proc] behaves differently:
    
    % proc x {} {puts "Proc in [namespace current]"}
    % namespace eval ::N { proc x {} {puts "Proc in [namespace 
    current]"} }
    
    That creates both ::x and ::N::x !
    
    May we add something like "(except that [proc] will create a 
    new procedure in a namespace instead of overwiting an 
    equally named procedure in the global namespace)"  ?
    
    Juan Carlos---
    
    
  2. login: "oox"
  3. mimetype: "text/plain"
  4. username: "oox"