##
## Compiler2 - PkgLib - Interp
##
## (C) IPN - Ingenieurbuero fuer Praezisionsnumerik
##
## Dipl.-Ing. Andreas Otto
## Ulmenstrasse 3
## D-34289 Zierenberg
## mailto:aotto@t-online.de
## http://tclcompiler.sourceforge.net
##
## Alle Rechte vorbehalten
##
namespace eval ::PkgLib::Interp {
variable Itp
}
##
## -----------------------------------------------------------------
##
proc ::PkgLib::Interp::Create {} {
variable Itp [ interp create -safe ]
interp expose $Itp file
interp alias $Itp EnvGet {} ::Env::LookUp
interp alias $Itp COMPILER_HOME {} ::Env::COMPILER_HOME
}
proc ::PkgLib::Interp::Delete {} {
variable Itp ; ## the interp to use
catch { interp delete $Itp }
}
##
## -----------------------------------------------------------------
##
proc ::PkgLib::Interp::UnAlias { T1 } {
variable Itp
if {![ info exists Itp ]} return
interp alias $Itp $T1 {}
}
proc ::PkgLib::Interp::Alias {T1 args} {
variable Itp
eval interp alias $Itp $T1 \{\} $args
}
proc ::PkgLib::Interp::Source {File} {
variable Itp
interp invokehidden $Itp -global source $File
}
proc ::PkgLib::Interp::Eval { Str } {
variable Itp
interp eval $Itp $Str
}