Zoran,
I can buy the general logic. However, consider how much code might be
broken by extending the same logic to:
nsv_set myarray key value
How many pieces of code currently do this, and assume its global? All of
it (that was run from a namespace) would break when it tried to access
it from somewhere else.
Rob Seeger
Zoran Vasiljevic wrote on 2/9/2005, 10:49 AM:
> On Wednesday 09 February 2005 16:11, Robert Seeger wrote:
> > Nsvs are, to me, global in essence. As such, I don't really see making
> > namespace aware as a good goal.
>
> This is what I thought...
> If you say:
>
> nsv_set myarray key value
>
> the implementation *could*
>
> figure out the namespace of your executing proc
> look for <namespace>::myarray
> if not found, look for myarray (default fallback)
>
> or vice-versa, (does not matter for now)
>
> One additional lookup will cost nothing (one hash lookup)
> in comparison to setting/getting the key.
> Admit, one should think this over for eventual traps
> (which I didn't do 100%) but this may work.
>
>
> > Rather than "appname_nsvname", you can just use "appname::nsvname" and
> > achieve the same functionality. This seems more intuitive to me, since
> > the apps commands are expected to be in the namespace.
>
> This is clear. Later on you decide to change the module name
> and you need go fix all those references....
> There has to be a better way.
> Idealy, you would name the namespace *once* in your sources.
> OK, you might as well say:
>
> nsv_set [namespace origin [lindex [info level 0] 0]]::myarray key
> value
>
> but I pitty the poor programmer having to write this.
>
> Zoran
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <[EMAIL PROTECTED]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]>
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
field of your email blank.