Path: utzoo!attcan!uunet!husc6!mailrus!ames!oliveb!tymix!antares!jms From: jms@antares.UUCP (joe smith) Newsgroups: comp.sys.amiga Subject: Re: ENV: variables (long) Summary: grouped vars Keywords: global vs local variables Message-ID: <151@antares.UUCP> Date: 10 Sep 88 07:58:04 GMT References: <8809090740.AA16138@cory.Berkeley.EDU> Reply-To: jms@antares.UUCP (joe smith) Organization: Tymnet QSATS, San Jose CA Lines: 44 One interesting non-Unix OS has 4 levels of variables; 2 on disk, 2 in memory. The order search is: 1) Check memory for definitions local to the current CLI 2) Check memory for definitions global to all CLIs from this session 3) Read user's permanent defaults from ~/vars/* 4) Read system-wide defaults from /vars/* The set-variable command modifies only the local variables unless the -global option is used, in which case the new value is visible to all CLIs that were created by the current logon session. When a new CLI is created, it inherits a copy of its parent's local variables. The new CLI cannot modify its parent's local variables, and cannot see any change to its parent's local variables, but it can see the session-wide global variables if it chooses to. The routine to lookup a variable will find the local value if one is defined, otherwise it will find the global variable. A program can explicitly request the global variable (bypassing the corresponding local value) if it wants. Global variable names are uppercase, local variables are lowercase. Generic variable names are a single word. Group variables are in the form "groupname.varname" and are initialized from the file ~/vargroupname the first time they are referenced. Shell variables are of the form "shell.*" (such as "shell.path=(/usr/bin /usr/local/bin"), which is better than the Unix convention. Instead of storing compiler options in names like FOOBAROPTS, names like FOOBAR.WIDTH, FOOBAR.LINESPERPAGE, FOOBAR.MODE are possible. The command "list-var FOOBAR.*" lists only the FOOBAR variables. I would like to see something like this on the Amiga. In particular: 1) Global variables visible to all tasks. 2) Local variables per process, copied from parent when process is created and easily located. 3) Routine to lookup a variable will find the local value if defined, otherwise automatically search for the corresponding global value. 4) The ability to see both the local and global settings of the same variable if desired. 5) Explicit grouping of variables, such as "groupname.varname", fully supported by the OS. -- +-----------------------------------------------------------------------------+ | TYMNET: JMS@F29 UUCP: {ames|pyramid}oliveb!tymix!antares!jms | | INTERNET: JMS%F29.Tymnet@Office-1.ARPA PHONE: Joe Smith @ (408)922-6220 | +-----------------------------------------------------------------------------+