ah ok, I thought you were refering to $initialize_variable that were called 
outside of the namespace evals..
ok, then...
but I'd like to suggest something.. instead of doing $::varname I think it 
would be best to use global varname; $varname ...and especially for namespace 
vars.. the reason
imagine you have a namespace MSN { $::MSN::protocol_version } and now we add 
multi protocol and we want namespace ::protocols::MSN { 
$::protocols::MSN::protocol_version } ... well, if we have hundreds of vars 
everywhere, we'd 
need to replace each one.. with 'variable' we won't need to...

same applies to global vars if we want them to become some days private vars of 
a namespace.. but that's less likely...
well, good luck with your changes!

KKRT

On Mon, Oct 16, 2006 at 10:30:13PM +0200, Jonne Zutt wrote:
> 
> What, I have to teach you something? :)
> Listen carefully, Youness, and I will explain.
> You are right that in ./amsn we source in the global namespace. Hence we 
> could access the initialize_amsn
> variable, which is located in the global namespace.
> However, we source (many) files that have there own namespaces. And in 
> there initialize_amsn
> is referenced, in which case we must specify a fully qualified name (or 
> else thanks to the Tip the variable is only searched in that namespace).
> 
> I have to run through all code (and plugins) once and check for each 
> variable how it is used.
> For example all "foo::varname" needs to be changed to "::foo::varname" 
> or "varname" (the latter accompanied by "variable varname") in namespace 
> foo. At some later point, all "variable x" statements can go out as well.
> 
> If it's not done before 0.96, that's okay with me. But I think we should 
> release 0.97 not much later than
> Tcl 8.5 is released (if this gets included). If users upgrade to tcl8.5, 
> they need an amsn version that has this fixed (without having to use 
> subversion).
> Anyway, not a problem right, just another good reason to release 0.97 
> apart from the nice stuff you added already lately.
> 
> I'll work on it tomorrow,
> JeeBee.
> 
> Youness Alaoui wrote:
> > ok, thanks, that was a fast answer :)
> > now Jonne, could you please confirm that the initialize_amsn variable is 
> > not accessible with the 
> > sources in this uplevel ? maybe it's a bug with tcl+tip which doesn't work 
> > right for upleveled 
> > code...
> > just confirm if it works or if it crashes.
> > Thanks,
> > KKRT
> >
> > On Mon, Oct 16, 2006 at 12:52:23PM -0300, miguel wrote:
> >   
> >> Youness Alaoui wrote:
> >>     
> >>> about the error you talked about with the initialize_amsn, look carefully 
> >>> at the reload_files 
> >>> proc, it does :
> >>> uplevel #0 {
> >>>   source ...
> >>>   source ...
> >>>   ...
> >>> }
> >>>
> >>> so all the sourcing is done in the global namespace, so $initialize_amsn 
> >>> should be access as is, 
> >>> no ened to fully qualify it since we're in the global namespace already...
> >>> at least, that's what I think, mabye Miguel can enlighten us on this 
> >>> subject as I may have not 
> >>> understood correctly what the changes this tip brings..
> >>>       
> >> Indeed: whatever happens in [upvar #0] is already running in the global
> >> namespace, so it does not need to be fully qualified. So: what is run at
> >> caller's scope in the sourced file (ie, not within namespace evals or
> >> procs) is fine.
> >>
> >> HTH
> >>
> >> Miguel
> >>
> >>     
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Amsn-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/amsn-devel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Amsn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to