|
2020-07-27
| ||
| 14:32 | • Ticket [2116892fff] Make SafeBase an actual package status still Open with 3... artifact: 25630fff18 user: dgp | |
|
2020-07-25
| ||
| 14:01 | • Ticket [2116892fff]: 3 changes artifact: 5335c65e56 user: kjnash | |
|
2020-07-23
| ||
| 19:16 | • Ticket [2116892fff]: 3 changes artifact: 7f429e502e user: dgp | |
|
2020-07-20
| ||
| 23:22 | • Ticket [2116892fff]: 8 changes artifact: 12e728d747 user: kjnash | |
|
2008-09-17
| ||
| 21:57 | • New ticket [2116892fff]. artifact: a09569ec36 user: dgp | |
Make SafeBase an actual package
Open2116892fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 6 years ago
Descriptionplain2008-09-17 21:57:55
The set of ::safe::* commands gets auto-loaded on first use. I suppose they're part of the built-in Tcl command set. But they're partitioned over in their own nice namespace, as if they were a package. Why not turn them into one? Call it "safe" so the package name matches the namespace name.
kjnash (claiming to be [email protected])plain2020-07-20 23:22:57
Good idea. I hope it can be done at the earliest possible release, subject to rules on breaking compatibility with existing code. I suppose this will mean Tcl 9.0.
dgpplain2020-07-23 19:16:40
Make this one of those "conversation with past self" videos. I suspect the trouble is the chicken & egg problem. A safe interpreter, whether created by a Tcl_MakeSafe() call, or by [interp crate -safe], does not have any exposed commands that can interact with the file system. In particular a safe interp cannot [source] or [load] into place any components that could make up a "safe" package until the functions of the "safe" package are already in place to enable safe access to the filesystem. We would have a circular dependency if we needed to [package require safe] before we had the capacities in place that would allow us to [package require safe]. If there's an escape from this dilemma other than the one we have (it's in the built-in language command set), let me know.
kjnashplain2020-07-25 14:01:54
I agree with your past self! I think it's about how the file lib/tcl8.6/safe.tcl is loaded in the master - no action is needed in the slave because the master adds the necessary aliases there. Currently the ::safe::* commands are listed in lib/tcl8.6/tclIndex or equivalent. The file lib/tcl8.6/safe.tcl could equally well be listed in a pkgIndex.tcl file (or converted to a module), which would need the master interpreter to evaluate "package require safe" before using any ::safe::* commands. The Safe Base commands are a natural package because they are self-contained in the ::safe namespace.
dgpplain2020-07-27 14:32:10
You should know better than me honestly. I never use the facility.
Log in (anonymous is fine) to add a comment.