TIP #277: CREATE NAMESPACES AS NEEDED ======================================= Version: $Revision: 1.3 $ Author: Miguel Sofer State: Draft Type: Project Tcl-Version: 8.7 Vote: Pending Created: Sunday, 01 October 2006 URL: https://tip.tcl-lang.org277.html Post-History: ------------------------------------------------------------------------- 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. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows