Subject: Re: Piping shell commands in clisp
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 22 Sep 2005 05:00:43 -0500
Newsgroups: comp.lang.lisp
Message-ID: <uemdnZPbzfRWHa_eRVn-1A@speakeasy.net>
Sam Steingold  <sds@gnu.org> wrote:
+---------------
| > * Matthew D Swank <nxbcn-vf-irel-zhpu-yvxr-zl-znvy-nqqerff@p.arg>:
| > Sam Steingold wrote:
| >> it would be nice to extend CLISP to full scsh compatibility.
| >
| > As far as the api or scsh's process notation?
| 
| both.
+---------------

I've looked at this several times [and posted here on the topic
once or twice], but I don't believe it is even *possible* in
portable Common Lisp without changing the Scsh syntax -- only
slightly, but *extremely* critically -- to require an explicit
backquote in Scsh's "process forms". As I wrote back in June:

    From: rpw3@rpw3.org (Rob Warnock)
    Message-ID: <7oSdnTfHGqi6ijjfRVn-iw@speakeasy.net>
    Date: Mon, 06 Jun 2005 22:40:23 -0500
    ...

    [Scsh] allows one to write things like this:

	(let ((foo "filename"))   ; RUN is a Scsh macro that does what
	  (run (ls -l ,foo)))     ;  might be called "implicit quasiquoting".

	(run (cc ,file ,@flags))  ; Compile FILE with FLAGS.

    Unfortunately those are illegal to a standard CL reader, as you
    have noted, so in a (hypothetical) "CLsh" the above would have to
    look like this:

	(let ((foo "filename"))
	  (run `(ls -l ,foo)))    ; Note explicit backquote

	(run `(cc ,file ,@flags)) ; (ditto)

Perhaps CLISP supports naked "," & ",@" as an extension [in the
UNQUOTE & UNQUOTE-SPLCING fashion of Scheme, maybe?], but CLHS CL
does not.

Still, while it would not permit *direct* porting of Scsh code
[which would be of limited utility in any case, since Scsh, being
Scheme-based, is a Lisp-1], I would personally *love* to see a
fleshed-out "CLsh", even with the requirement for explicit backquotes
in the Scsh-like "process forms".


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607