Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TIP229: namespace path

Closed / Fixed1159942fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2005-03-09 15:50:01
Implementation of [namespace path ?list?]
dkfplain2005-03-09 22:50:03
File Added - 124836: nsPath.diff
dkfplain2005-03-09 23:00:57
File Added - 124839: nsPath.diff
dkfplain2005-03-09 23:00:58
File Deleted - 124836:
msoferplain2005-03-10 01:54:02
Logged In: YES 
user_id=148712

I'm worried about the speed implications, as I do not
immediately see how the core can cache already resolved
command names and insure that the cached values are correct.
The problem is (un)shadowing of commands at different levels
in the search path. The test namespace-51.5 (added in the
patch as knownbug) illustrates the point.

One possibility is to disable caching selectively: commands
called from a namespace that has a non-empty search path are
only cached if they reside in that namespace.

Later on, we may design a mechanism to cache all commands
and detect shadowing/unshadowing effects. I am not sure if
this can be done reasonably in presence of dynamic paths.
The core currently does this, but with fixed search paths of
length 2 (as given by Tcl's resolution rules).
dkfplain2005-04-22 04:43:01
Logged In: YES 
user_id=79902

Here's an updated version.

Resolution cacheing is implemented (and in fact the main
problem has been over-eager cacheing, not insufficient
cacheing!) as is a bunch of issues relating to what happens
in tricky lifetime-management cases. Everything's also now
object-aware, and errors relating to unknown namespaces are
generated early.
dkfplain2005-04-22 04:43:20
File Added - 131247: tip229.diff
dkfplain2005-04-22 22:16:58
Logged In: YES 
user_id=79902

And another version, with cleaner internal API (possibly
worth exposing in the future) and more extensive testing.
dkfplain2005-04-22 22:17:02
File Added - 131329: tip229.diff
dkfplain2005-04-22 22:17:21
File Deleted - 131247:
dkfplain2005-04-22 22:17:22
File Deleted - 124839:
dkfplain2005-04-26 05:25:16
Logged In: YES 
user_id=79902

ToDo: Fix InfoCommandsCmd in tclCmdIL.c; when the pattern is
namespace-less, need to add all (matching) commands from the
whole path.
dgpplain2005-05-10 04:38:11
Logged In: YES 
user_id=80530


One really minor quibble with the
new namespace-51.* tests.
They assume the -body of each test
will run in the global namespace.  These
tests will be more robust if they do their
own [namespace eval :: {...}].
dkfplain2005-05-11 22:20:13
File Deleted - 131329: 



File Added - 134007: nsPath.diff
dkfplain2005-05-20 22:35:09
Logged In: YES 
user_id=79902

Update to handle more of dgp's wish-list.

No docs yet.
dkfplain2005-05-20 22:35:13
File Added - 135281: nsPath.diff
dkfplain2005-05-20 22:35:17
File Deleted - 134007:
dkfplain2005-06-01 15:07:28
Logged In: YES 
user_id=79902

Implementation (based on patch here) checked into HEAD
Log in (anonymous is fine) to add a comment.

Attachments: