Re: Differing namespace behavior in Tcl 9.0b2

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Differing namespace behavior in Tcl 9.0b2
De : et99 (at) *nospam* rocketship1.me (et99)
Groupes : comp.lang.tcl
Date : 17. Jul 2024, 04:17:38
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v77d4i$1lkhh$1@dont-email.me>
References : 1
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1
On 7/16/2024 2:52 PM, Andrew Mangogna wrote:
I have been out of the Tcl loop for a while, but have been porting an old
"C" based extension of mine to Tcl 9.0b2. The port went well, required
very few changes, but I have some differing behavior that I'm trying to
track down. The package consists of an ensemble command, "ral" which
has three subcommands implemented in the "::ral" namespace. Each of
the subcommands is also exported from the namespace. The following shows
the problems:
 For Tcl 8.6:
 % info patchlevel
8.6.11
% package require ral
0.12.2
% info commands ral
ral
% namespace export
% ral relvar names
% relvar names
invalid command name "relvar"  <- expected
% namespace import ::ral::*
% relvar names
% namespace export
%
 For Tcl 9.0b2:
 % info patchlevel
9.0b2
% package require ral
0.13.0                      <- new port to Tcl 9
% info commands ral
ral
% namespace export
tuple relation relvar       <- unexpected -- ral exports these commands
                             <- but they shouldn't appear in the global
                             <- namespace
% ral relvar names
% relvar names
invalid command name "relvar" <- expected, just as Tcl 8.6
% namespace import ::ral::*
% relvar names
invalid command name "relvar" <- unexpected
% namespace export
tuple relation relvar         <- again, not sure why these appear
 So my question is, "Is there some namespace / ensemble changes that I've
not been able to track down?" It appears that the ensemble works
correctly, but that the exported commands are no longer exported or
available.
 Thanks,
 Andrew Mangogna
 
I Don't know if this is your issue, but there is one incompatibility I know of in 9.0 from the release notes:
important Incompatibilities in Tcl 9.0
     Namespace varname resolution: Current namespace, not global.
As far as I can tell, by looking up the manual for 9.0 from an internet search and finding
https://www.tcl-lang.com/man/tcl9.0/TclCmd/namespace.html
the manual entry on name resolution is not changed there from 8.6. However, I do know that some code I've used under 9.0 had to be changed when it assumed the old way. In particular some of the tcl_* globals needed to add :: in front of the variable names since it would no longer find them in the global namespace when used inside of a namespace without the ::tcl_*.

Date Sujet#  Auteur
16 Jul 24 * Differing namespace behavior in Tcl 9.0b26Andrew Mangogna
17 Jul 24 +- Re: Differing namespace behavior in Tcl 9.0b21et99
17 Jul 24 +- Re: Differing namespace behavior in Tcl 9.0b21Ashok
17 Jul 24 +- Re: Differing namespace behavior in Tcl 9.0b21Ashok
17 Jul 24 `* Re: Differing namespace behavior in Tcl 9.0b22Andreas Leitgeb
17 Jul 24  `- Re: Differing namespace behavior in Tcl 9.0b21Andrew Mangogna

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal