Return-Path: Delivered-To: apmail-tcl-rivet-dev-archive@tcl.apache.org Received: (qmail 89137 invoked by uid 500); 23 Mar 2002 19:23:43 -0000 Mailing-List: contact rivet-dev-help@tcl.apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list rivet-dev@tcl.apache.org Received: (qmail 89058 invoked from network); 23 Mar 2002 19:23:43 -0000 To: Damon Courtney Cc: Wojciech Kocjan , rivet-dev@tcl.apache.org Subject: Re: Global References: From: davidw@dedasys.com (David N. Welton) Supersedes: <87n0wznq1r.fsf@dedasys.com> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 X-Gnus-Article-Number: 2872 Sat Mar 23 18:37:36 2002 Date: 23 Mar 2002 20:26:19 +0100 Message-ID: <87d6xvkrvo.fsf@dedasys.com> Lines: 39 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Damon Courtney 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