Newsgroups: comp.os.misc
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!uw-beaver!ubc-cs!alberta!arcsun.arc.ab.ca!arcsun!kenw
From: kenw@skyler.arc.ab.ca (Ken Wallewein)
Subject: Re: Globbing
In-Reply-To: jlg@cochiti.lanl.gov's message of 20 Mar 91 17:39:45 GMT
Message-ID: <KENW.91Mar21140655@skyler.arc.ab.ca>
Sender: nobody@arc.ab.ca (Absolutely Nobody)
Organization: Alberta Research Council, Calgary Alberta, Canada
References: <17602@lanl.gov> <WG0A148@xds13.ferranti.com> <18205@lanl.gov>
	<A23AFH9@xds13.ferranti.com> <18365@lanl.gov>
	<B.3A_=8@xds13.ferranti.com> <18511@lanl.gov>
Date: 21 Mar 91 14:06:55

In article <18511@lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:

   ...
   I didn't deny it.  But I will.  The shell scripting syntax and semantics
   do indeed constitute a language.  But, the shell itself is an intermediary.
   It is nothing more than a particularly poorly informed interpreter.  If
   the shell scritping language allowed arguments to be given _types_, then
   the problem would solve itself: the shell could glob (once) any argument
   which had the data type <list-of-files>.  Any other argument it would
   leave alone.  This would be a workable solution.  _BUT_ it would require
   that all commands be declared to the shell so that it would know the
   types of the command's arguments.  Various people in this discussion have
   asserted that this is an unacceptable solution.*  The second best is to 
   each command evaluate its own arguments - the command knows what they
   mean.  The third best solution is to have the user explicitly evaluate
   the arguments himself - he also knows what they mean (or he has no 
   business using the command), but it's just a lot of unnecessary work
   to force the user to glob manually.  The _worst_ solution is to have
   the _shell_ do the argument evaluation _blindly_ - which is what you
   are advocating.

Nice summary. 

   J. Giles

   Footnote[*]:  I have no idea why people think a shell which required 
                                                               ^^^^^^^^
   all command names to be declared is unacceptable.  It is standard CS
   dogma that all things must be declared in a language.  Yet this is
   resisted in the command language.  These days, it's even common for
   languages to require declarations of external procedures (right down
   to the types of the arguments) - this is just the sort of model for
   command languages I have described above.

I think there have been some reasonable concerns expressed about this
approach, although many of them show lack vision or familiarity with
working examples.

There's a compromise solution which might be more acceptable.  If we
changed that word "required" to "allowed", it would be a lot more practical
to implement in current environments.  In would still, however, be subject
to other limitations of shell syntax.

--
/kenw

Ken Wallewein                                                     A L B E R T A
kenw@noah.arc.ab.ca  <-- replies (if mailed) here, please       R E S E A R C H
(403)297-2660                                                     C O U N C I L

