Re: Variables and Procedures scope
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Variables and Procedures scope

From: Donald Arseneau <asnd@triumf.ca>
Date: Sun Jul 31 2005 - 21:15:37 CEST

"Silas Justiniano" <silasju@gmail.com> writes:

> entry .mytop.myentry -variable globals::myvar

You seem to be thinking of namespaces as just another type of globals.

> var v2 #valid to all scopes below, but not for f1 and outside that

That is a namespace. You could create a proc to simplify creation
of namespaces for such hierarchies of procs, to look cleaner (and
more specific to that application).

Anyway, the one thing for which I find namespaces indispensible
is an application like you show, but the procs are *not* nested
but sequential! When you take what would be one sequential proc,
and split it up into sections so the event loop can perform it
in stages, then you want to change the local variables into
namespace variables.

-- 
Donald Arseneau                          asnd@triumf.ca
Received on Thu Sep 29 14:28:11 2005