TOC PREV NEXT INDEX

 


Example 2: Procedures Used with Namespace


TclPro Compiler does not currently understand the namespace eval command enough to know that arguments to namespace eval form a Tcl script, so that nothing that follows namespace eval is compiled, including procedures.

Example 2 shows two procedures: a procedure defined inside a namespace eval construct and one defined outside it. In this example, namespace eval prevents procedure bodies from being compiled.


# Example2.tcl--
namespace eval sample {
    namespace export not_compiled compiled

    proc not_compiled {a1 a2} {
        return [list $a1 $a2]
    }
}
proc sample::compiled {a1 a2} {
puts "hello"
}



http://www.ajubasolutions.com
Voice: (650) 210-0100
Fax: (650) 210-0101
support@ajubasolutions.com
TOC PREV NEXT INDEX