Provided by: manpages-zh_1.5.2-1_all bug

NAME

       namespace -

 SYNOPSIS
       namespace ?option? ?arg ...?
_________________________________________________________________

 DESCRIPTION
       namespace WHAT IS A NAMESPACE? ()  option  option

       namespace children ?namespace? ?pattern?
                 namespace   namespace(fully-qualified)  ::   pattern   :   ::
              namespace  ()

       namespace code script
                script  (Capture)  script    namespace  inscope    script    (
              namespace  code)     script    ::a::b set script [namespace code
              {foo bar}] eval "$script x y"    (  script   )   namespace  eval
              ::a::b {foo bar x y}  Tk   (scoped)SCOPED VALUES ()

       namespace current
              () ::

       namespace delete ?namespace namespace ...?
               namespace

       namespace eval namespace arg ?arg ...?
               namespace   arg     eval

               namespace

       namespace export ?-clear? ?pattern pattern ...?
                namespace  import  namespace  export   () pattern   () pattern
              -clear      pattern  patterns  -clear

       namespace forget ?pattern pattern ...?
               pattern  foo::x  a::b::p* :: pattern    namespace import

       namespace import ?-force? ?pattern pattern ...?
                patternfoo::x   a::p*   pattern    -force   namespace   import
              (snapshot): () namespace import ()

       namespace inscope namespace arg ?arg ...?
                namespace  code  Tk  lappendnamespace  inscope  namespace eval
              namespace inscope ::foo a x y z namespace eval ::foo  [concat  a
              [list x y z]] lappend>

       namespace origin command
               command a, b,...,n  a command(command)

       namespace parent ?namespace?
               namespace  namespace

       namespace qualifiers string
               string  :: string ::foo::bar::x ::foo::bar :: namespace tail

       namespace tail string
               :: string ::foo::bar::x x :: namespace qualifiers

       namespace which ?-command? ?-variable? name
               name   name  variable trace()nameNAME RESOLUTION ()

 WHAT IS A NAMESPACE?
       (collection)Tcl global namespace ()namespace eval
              namespace eval Counter {
                  namespace export bump
                  variable num 0

                  proc bump {} {
                      variable num
                      incr num
                  }
              }
        num   bump  bump Counter  bump

        Tcl  variable

        namespace eval(over time):
              namespace eval Counter {
                  variable num 0
                  proc bump {} {
                      variable num
                      return [incr num]
                  }
              }
              namespace eval Counter {
                  proc test {args} {
                      return $args
                  }
              }
              namespace eval Counter {
                  rename test ""
              }
        Counter   test  rename

 QUALIFIED NAMES
       history    ::safe::interp   ::   /   .  (qualified)  Unix   Tk   ()  ::
       ::safe::interp::create   ::safe  interp  create::safe  ::

        Counter :
              Counter::bump 5
              Counter::Reset
        count ():
              puts "count = $Counter::num"
        Foo Counter bump :
              Foo::Counter::bump 3

        Foo:
              proc Foo::Test {args} {return $args}
       :
              rename Foo::Test Bar::Test

       (cover) ::   :  :  ::  {}  ::

NAME

        Tcl setprocrename interp alias ::  ::    ()Tcl :

       ,
              set traceLevel 0
              namespace eval Debug {
                  printTrace $traceLevel
              }
       Tcl  Debug  traceLevel printTrace:
              set traceLevel 0
              namespace eval Foo {
                  variable traceLevel 3

                  namespace eval Debug {
                      printTrace $traceLevel
                  }
              }
        Tcl  Foo::Debug  traceLevelTcl  Foo::traceLevel

        namespace which  :
              namespace eval Foo::Debug {namespace which -variable traceLevel}
         ::traceLevel
              namespace eval Foo {namespace which -variable traceLevel}
        ::Foo::traceLevel.

        :: namespace eval

       Tcl

        variable   global global variable

 IMPORTING COMMANDS
         BLT  Blt :
              Blt::graph .g -background red
              Blt::table . .g 0,0
        graph  table   Blt:::
              namespace import Blt::*
        Blt:
              graph .g -background red
              table . .g 0,0
       namespace import namespace export

              namespace import Blt::graph Blt::table
        graph  table

       ()(reissue) namespace import(pick up) -force   (overwritten):
              namespace import -force Blt::graph Blt::table
        namespace forget :
              namespace forget Blt::*
        Blt  Blt Blt::

       ():
              rename Blt::graph ""

 EXPORTING COMMANDS
       :
              namespace eval Counter {
                  namespace export bump reset
                  variable Num 0
                  variable Max 100

                  proc bump {{by 1}} {
                      variable Num
                      incr Num $by
                      Check
                      return $Num
                  }
                  proc reset {} {
                      variable Num
                      set Num 0
                  }
                  proc Check {} {
                      variable Num
                      variable Max
                      if {$Num > $Max} {
                          error "too high!"
                      }
                  }
              }
        bump   reset   Counter :
              namespace import Counter::*
        Check

       namespace importnamespace export  namespace import

 SEE ALSO
       variable(n)

 KEYWORDS
       exported, internal, variable

[]


[]

       2001/10/12

 Linux  man :
       http://cmpp.linuxforum.net