Namespace is a container for a set of identifiers that are used to group variables and procedures.

Example:

namespace eval MyMath {
    # Create a variable inside the namespace
    variable myResult
}
# Create procedures inside the namespace
proc MyMath::Add {a b } {
    set ::MyMath::myResult [expr $a + $b]
}
MyMath::Add 10 23
puts $::MyMath::myResult

Result:

33

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading