The default auto_path for a safe interp created with safe::interpCreate doesn't load tcllib packages that have their sources in deeper subdirectories.
e.g
% safe::interpCreate x
x
% x eval {package require page::parse::peg}
0.1
% x eval {package ifneeded page::parse::peg 0.1}
source {$p(:42:)/tcllib1.21/page/parse_peg.tcl}
% x eval {package require page::writer::peg}
permission denied
% x eval {package ifneeded page::writer::peg 0.1}
source {$p(:42:)/tcllib1.21/page/plugins/writer_peg.tcl}
The same situation occurs with various tcllib term subpackages such as: term::ansi::code
It can be worked around with something like:
%safe::interpAddToAccessPath x c:/tcl87/lib/tcllib1.21/page/plugins
But from what I can see in the safe base documentation - these should load by default. I have only encountered it so far with some tcllib packages - but I assume the folder depth issue may affect custom packages structured in this way too.
|