ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activetcl
activetcl
Re: [Activetcl] Active state, ::safe:: base, and package require
by Andreas Kupries other posts by this author
Jun 20 2008 11:39AM messages near this date
view in the new Beta List Site
Re: [Activetcl] Active state, ::safe:: base, and package require | [Activetcl] Regarding the SOCKS proxy login
> 
>  Yet another problem quickly analysed, Andreas :/
>  Thanks much !
> 
>  Should I report the problem to tcl's bug tracker ?

Yes.

> 
>  As far as I understand your mail, Andreas, there is no work arround the
>  problem until the safe-base mechanism is corrected ?

AFAIK no.

>  However, since the command package is available in safe interpreters, and
>  since I bet that the new TM mechanism is handled in the package command,
>  perhaps I could get some hack ?

Remember, a big part of the 'package' command, the search for packages, is
implemented in Tcl and plugged into the main command via 'package unkown'.
The relevant pieces of the core are in 'init.tcl', which sets up the
plugging, 'package.tcl' handling the general package mechanism, and 'tm.tcl'
for the Tcl Modules.

I haven't looked into the safe base for quite some time, last three years
back, I think, so I do not really know how feasible a hack is.

You are not in the 'package' command per se I think.


>  I've tried to do expose the master's load and source commands, and also to
>  set the safe interpreter's auto_path be identiqual to the master's.
>  Unfortunately, the safe still cannot find the package:
> 
>     % interp create -safe
>     interp0
>     % interp expose interp0 load
>     % interp expose interp0 source
>     % interp eval interp0 "set auto_path \"$auto_path\""
>     /Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts
>  /Library/Frameworks/Tcl.framework/Versions/8.5/Resources /usr/local/lib
>  ~/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl
>  ~/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks
>  /System/Library/Frameworks /Library/Tcl/teapot/package/macosx-ix86/lib
>  /Library/Tcl/teapot/package/macosx-universal/lib
>  /Library/Tcl/teapot/package/tcl/lib
>     % interp eval interp0 "package require math::linearalgebra"
>     can't find package math::linearalgebra
> 
>  Mmmhhh.. now I am lost again...
>  Given the above piece of code, what is different when executing package
>  require in the safe interpreter on the one hand, in the master on the
>  other ?

The search mechanism might be set up differently, see above about 'package
unknown' and the various files, and I think the safe base introduces some
sort of virtual paths which get translated by the aliases in the master into
the proper path names. I my dim recollection of its internals is right.


>  Perhaps someone would have a suggestion to let my safe interp require the
>  tcllib packages ?
> 
>  Best-
>  Nicolas
> 
> 
>  PS : just to let pple know...
>  I just noticed that the problem happens also on the mac.
>  There, I can load a math::bignum package in a safe interp, but it's the
>  old 8.4 package. The newer version that comes with activetcl8.5 is not
>  available in the safe interp, just as on Linux.
>  Quite logical, since it relates to the new tcl module TM system.


--
	Andreas Kupries <andreask@[...].com> 
	Developer @ http://www.ActiveState.com
	Tel: +1 778-786-1122


_______________________________________________
ActiveTcl mailing list
ActiveTcl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Nicolas Castagne
Andreas Kupries
Nicolas Castagne
Andreas Kupries

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved