Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.arch Subject: Re: shell architecture (to glob or not to glob) Message-ID: <18003@cbmvax.commodore.com> Date: 24 Jan 91 05:04:03 GMT References: <1991Jan14.013815.11419@ims.alaska.edu> <11314@lanl.gov> <5340@idunno.Princeton.EDU> <1991Jan14.170115.17178@Think.COM> <360@bria> <1991Jan17.185527.9824@Neon.Stanford.EDU> <365@bria> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 32 In article kenw@skyler.arc.ab.ca (Ken Wallewein) writes: > Well, it might, if it were done that way. The implementation with which >I am familiar doesn't, and it works rather well. The syntax of the command >is described in a special "concise command language", which is compiled >into a library, and which the shell keeps in shared memory. AmigaDos 2.0 has a similar ability (ReadArgs()). It greatly helps improve the consistency of user-interfaces (quick, which unix commands take '-' parameters only before others, for no really good reason except easier parsing?) It's part of a shared library (as are most things). > This has a number of benefits, including _simplified_ software >development (because the syntax of the commands can be decoupled from the >code itself), flexibility (you can call the parser from within your program >if you want to), flexibility (you can change the command syntax without >changing the program -- you don't even need source!), efficiency (you don't >even bother to load the program if the command doesn't follow the required >syntax), and so on. Well, in AmigaDos it's called from within the program, but otherwise you get similar effects (for example, you could extend the library call to allow it to optionally open a window with widgets for playing with all the available arguments, etc). It can also be used to parse files, if the format is reasonably close to a command-line format (which is keyword based on the Amiga). -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com BIX: rjesup The compiler runs Like a swift-flowing river I wait in silence. (From "The Zen of Programming") ;-)