TIP #277: Create Namespaces as Needed
_____________________________________________________________________________
TIP:	277
Title:	Create Namespaces as Needed
Version:	$Revision: 1.3 $
Authors:	Miguel Sofer <msofer@users.sourceforge.net>
State:	Draft
Type:	Project
Tcl-Version:	8.7
Vote:	Pending
Created:	Sun Oct 01 00:00:00 UTC 2006
Abstract
This TIP proposes that namespaces be created automatically whenever a script tries to create a command, variable or child namespace in it.
Proposal
As proposed in [[FR 582926]], whenever a script tries to create a command, variable or namespace, Tcl should automatically create all namespaces in the path if they do not already exist.
In other words, as an example, the current behaviour
   % namespace children [namespace current]
   ::activestate ::tcl
   % set a::b::x 2
   can't set "a::b::x": parent namespace doesn't exist
   % namespace children [namespace current]
   ::activestate ::tcl
should become
   % namespace children [namespace current]
   ::activestate ::tcl
   % set a::b::x 2
   2
   % namespace children [namespace current]
   ::a ::activestate ::tcl
   % namespace children ::a
   ::a::b
Reference Implementation and Documentation
Forthcoming at SF.
Copyright
This document has been placed in the public domain.
_____________________________________________________________________________
Colophon
TIP AutoGenerator - written by Donal K. Fellows