tcl-rivet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject Re: Global
Date Sat, 23 Mar 2002 19:26:19 GMT
Damon Courtney <damon@your.unreality.com> writes:

>     I'll give you a better example.  I ran into this while
> developing a project the other day, and I had to completely re-write
> the way I was doing things because of this limitation.

>     I create a namespace for my procedures.  I plan to put in a
> really slick packaging system for Rivet with each package in its own
> namespace.  So, we have:

> namespace eval ::some_package {

> }

>     See a problem?  Most packages create themselves relative to the
> global namespace.  This will become a problem when they use
> variables within their namespace.  Why?  Because that namespace will
> never be destroyed with the rest.  So, the next time a page loads,
> variables already exist that are from last time.  Bad juju.

>     Now, if we make the global command OUR global command, we just
> write all packages with global's instead of variable's, and it

So, we would have to rewrite packages to work with Rivet?

The ultimate goal is to make sure that people can take Tcl code and
"just use it" - or at least I think that's what we should aim for.

> ensures that all variables are kept within the ::request namespace.
> Very rarely should there ever be a case when a user needs the REAL
> global command.  And even if they did, 'upvar #0' works as a nice
> substitute. 0-]

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Mime
View raw message