On 10/6/06, Martin Bähr <[EMAIL PROTECTED]> wrote: > On Fri, Oct 06, 2006 at 12:04:47AM +0200, Axel Liljencrantz wrote: > > The 'local' and 'global' names are used in so many other languages > > that it is very probable that most fish users will be familiar with > > the terms. > > in which languages? > i absolutely do not have that perception.
Bash uses the term 'local variable' with the same meaning as in fish, though I couldn't find any place in the manual mentioning global variables. Note that the builtin for making a variable local is called 'local'. Both terms are used in various places in "The C++ programming language" by Stoustrop. They are used in the official PHP language manual, see for example http://www.php.net/manual/en/language.variables.php. Also note that the array containing all global variables n PHP is called $_GLOBALS. See also the entrys 'Variable' 'Local_variable' and 'Global_variable' on Wikipedia. These articles strongly suggest that these are standard terms. I don't have time to look up any more places right now, but I belive I've seen the terms used in the K&R C book, in the MATLAB manual, JavaScript manuals, Pascal Manuals, introductory computing textbooks and in various other places. I really belive these are common terms. > > and even then i do not consider shell script a full programming language, > so i do not think the terms qualify. The concept is _exactly_ the same though. To me, it would be a bit confusing to support a widely implemented programming feature used in most other languages under the same name, but then chose a comlpetely different name. > > sh does not have a concept of variable scopes (unless you count export) No, but bash an zsh do, though the syntax make them pretty useless, IMO. But exporting is unrelated. You can export universal, global and local variables in fish. > global variables in programming languages are usualy perceived as > something bad, so some modern programming languages do not even support > them. True, but the situation is different in shells. Variables are used to confgure the system in shells, so they partially replace config files. > > and also given that within a shell, external programs are part of the > shell language, which would imply that global variables are available to > external programs as well. but given that this is not the case unless > they are exported, a global variable in a programming language just > feels like something totally different from an environment variable in > a shell. Not in my eyes. Obviously, this is purely a matter of perspective/opinion/whatever. But regardless of if they feel differently, the scoping rules in fish work just like in other non-shell languages. > > > As to 'universal', 'system-wide' is slightly better as well, though it > > might be confused with some kind of 'system variables', i.e. some kind > > of read only variables that tell you the current system state. > > i am unaware of the existance of such variables. Yes, it was a made up concept. I meant that the name could be interpreted that way. > > > Also, I think that the name 'universal' fits in very will with the > > pattern of local and global. > > yes, but it makes me think that this is something that can be shared > across multiple machines. global makes me think of system-wide (consider > the term "world-readable" actually meaning readable system-wide.) world-readable sound to me like everybody having read access, and implies that not everybody would have write access. > > > It's a whole metaphore where the distance from the > > user also reflects the ordering. > > yes, that's a nice part about it. > > greetings, martin. > -- > cooperative communication with sTeam - caudium, pike, roxen and unix > offering: programming, training and administration - anywhere in the world > -- > pike programmer travelling and working in europe open-steam.org > unix system- bahai.or.at iaeste.(tuwien.ac|or).at > administrator (caudium|gotpike).org is.schon.org > Martin Bähr http://www.iaeste.or.at/~mbaehr/ > -- Axel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
