The namespace Command

   

Practical Programming in Tcl & Tk, Third Edition
By Brent B. Welch

Table of Contents
Chapter 14.  Namespaces


The namespace Command

Table 14-1 summarizes the namespace operations:

Table 14-1. The namespace command.
namespace currentReturns the current namespace.
namespace children ?name? ?pat?Returns names of nested namespaces. name defaults to current namespace. pat is a string match pattern that limits what is returned.
namespace code scriptGenerates a namespace inscope command that will eval script in the current namespace.
namespace delete name ?name? ...Deletes the variables and commands from the specified namespaces.
namespace eval name cmd ?args? ...Concatenates args, if present, onto cmd and evaluates it in name namespace.
namespace export ?-clear? ?pat? ?pat? ...Adds patterns to the export list for current namespace. Returns export list if no patterns.
namespace forget pat ?pat? ...Undoes the import of names matching patterns.
namespace import ?-force? pat ?pat? ...Adds the names matching the patterns to the current namespace.
namespace inscope name cmd ?args? ...Appends args, if present, onto cmd as list elements and evaluates it in name namespace.
namespace origin cmdReturns the original name of cmd.
namespace parent ?name?Returns the parent namespace of name, or of the current namespace.
namespace qualifiers nameReturns the part of name up to the last :: in it.
namespace which ?flag? nameReturns the fully qualified version of name. The flag is one of -command, -variable, or -namespace.
namespace tail nameReturns the last component of name.


       
    Top
     



    Practical Programming in Tcl and Tk
    Practical Programming in Tcl and Tk (4th Edition)
    ISBN: 0130385603
    EAN: 2147483647
    Year: 1999
    Pages: 478

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net