From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from harvard.harvard.edu ([128.103.1.1]) by archone.tamu.edu with SMTP id <22543>; Mon, 26 Aug 1991 15:04:51 -0500 Received: by harvard.harvard.edu (5.54/a0.25) (for rc@archone.tamu.edu) id AA10207; Mon, 26 Aug 91 16:01:46 EDT Received: from gatech.UUCP (uucp.gatech.edu) by gatech.edu (4.1/Gatech-9.1) id AA04156 for archone.tamu.edu!rc; Mon, 26 Aug 91 15:54:53 EDT Received: from skeeve.UUCP by gatech.UUCP (4.1/SMI-4.1) id AA09928; Mon, 26 Aug 91 15:54:49 EDT Received: by skeeve.ATL.GA.US (smail2.5) id AA00822; 26 Aug 91 14:38:54 EDT (Mon) From: gatech!skeeve!arnold@harvard.harvard.edu (Arnold D. Robbins) Date: Mon, 26 Aug 1991 13:38:51 -0500 X-Mailer: Mail User's Shell (6.5.6 6/30/89) To: rc@archone.tamu.edu Subject: Re: rc as an embedable language Message-Id: <9108261438.AA00822@skeeve.ATL.GA.US> > Date: Sat, 24 Aug 1991 01:19:13 -0500 > From: emory!redvax.uucp!hugh ("D. Hugh Redelmeier") > Subject: rc as an embedable language > > I like interactive visual editing of history in an interactive > shell. There. I have admitted it. I even like filename completion! Me too! > I don't like fat and ugly interactive history support in my scripting > language. Me too! > How can these be resolved? Some ways: A fourth way: - Put all the interactive candy into readline. This is what Byron chose, and is actually reasonable. At my urging, Chet Ramey of bash fame has been beating on vi mode in readline. I sent him diffs so that when a person does a file name completion on ; echo ~arnold/a* readline turns it into ; echo /u/arnold/a1 /u/arnold/a2 so that rc never sees the ~ stuff (diffs work for vi and emacs mode). I almost had it working so that a new key did plain tilde expansion. This is a compromise --- the user has to type something to do the expansion, but the hair all stays in readline. For scripts, a simple function would do: fn homedir { for (i) awk -F: '$1 == '$i' { print $6 }' } echo `{homedir arnold joe jane} > I would like to suggest that a version of the first technique could > have some advantages. If rc were implemented as a (shared?) > library, like TCL, it would be easy to create two variants of the > same shell. One could have the interactive candy; one could be a > lean and elegant scripting shell. Much of the two shells would be > shared. > > This library would also be attractive as an embeddable language, > much like Scheme and TCL. This has some real possiblities. David Korn once told me about some work people did making ksh an embeddable language, and hooking it into their X-Windows application. They could write a ksh script for when buttons were pushed etc. I think rc is more attractive for this sort of thing, since it's a lot smaller. The concept is by no means far-fetched. Arnold