From: Tushar Saxena
Subject: run-program in kcl
Date: 
Message-ID: <1992Aug13.194657.6098@cs.albany.edu>
There is a function in common lisp called RUN-PROGRAM in Sun Common Lisp.
First of all, has anyone ever heard of it? Secondly, what does this
function do? And lastly, what is its counterpart in kcl. I know for sure
that my version of kcl does not support it.

Another thing that I would like to know is about the -load option of invoking
common lisp. In common lisp, you can invoke lisp by an option -load <filename>
which will load a given file into the interpreter before getting into it. I
was wondering what its counterpart in kcl is. I know (again) for sure that
my version of kcl does not do anything for -load or -l.

Thanks in advance for the help.

ttfn
        -Tush.

--------------------------------------------------------------------------------
And any fool knows a dog needs a home, A shelter from pigs on the wing.
        -Roger Waters
--------------------------------------------------------------------------------
email : ······@cs.albany.edu                        Computer Science Department
Phone : 518-442-3388                                SUNY Albany
Tushar Saxena                                       Albany NY 12222 (USA)
--------------------------------------------------------------------------------

From: Barry Margolin
Subject: Re: run-program in kcl
Date: 
Message-ID: <16fpq4INN848@early-bird.think.com>
In article <·····················@cs.albany.edu> ······@cs.albany.edu (Tushar Saxena) writes:
>There is a function in common lisp called RUN-PROGRAM in Sun Common Lisp.

This isn't a Common Lisp function, it's a Lucid extension.

>First of all, has anyone ever heard of it? Secondly, what does this
>function do? 

It runs a normal Unix program, as if you'd executed it from the shell.  It
can optionally connect the input and/or output streams of the program to
Lisp streams.  It's fully documented in the Working Beyond the Lisp
Environment section of the Advanced User's Guide chapter of the manual.

>	      And lastly, what is its counterpart in kcl. I know for sure
>that my version of kcl does not support it.

There probably isn't a direct counterpart in KCL, since KCL doesn't provide
many extensions to CL.  The closest thing is probably calling the Unix
execlp(3) function.

>Another thing that I would like to know is about the -load option of invoking
>common lisp. In common lisp, you can invoke lisp by an option -load <filename>
>which will load a given file into the interpreter before getting into it. I
>was wondering what its counterpart in kcl is. I know (again) for sure that
>my version of kcl does not do anything for -load or -l.

Common Lisp doesn't specify anything about how Lisp is started, let alone
comand line options.  This is another Lucid extension.  There may not be a
KCL facility like this.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar
From: Gordon Buxton
Subject: Re: run-program in kcl
Date: 
Message-ID: <4280@inca.comlab.ox.ac.uk>
In article <············@early-bird.think.com> ······@think.com (Barry Margolin) writes:
>In article <·····················@cs.albany.edu> ······@cs.albany.edu (Tushar Saxena) writes:
>>There is a function in common lisp called RUN-PROGRAM in Sun Common Lisp.
>
>This isn't a Common Lisp function, it's a Lucid extension.
>
>>First of all, has anyone ever heard of it? Secondly, what does this
>>function do? 
>
>It runs a normal Unix program, as if you'd executed it from the shell.  It
>can optionally connect the input and/or output streams of the program to
>Lisp streams.  It's fully documented in the Working Beyond the Lisp
>Environment section of the Advanced User's Guide chapter of the manual.
>
>>	      And lastly, what is its counterpart in kcl. I know for sure
>>that my version of kcl does not support it.
>
>There probably isn't a direct counterpart in KCL, since KCL doesn't provide
>many extensions to CL.  The closest thing is probably calling the Unix
>execlp(3) function.
>
>······@think.com          {uunet,harvard}!think!barmar


There is a sort-of similar function in kcl called 'system'.  I don't
think it is as good as the run-program in lucid, but it might be what
you need ... eg:

>(system "ls")
beef           factory        filesys.lsp    plan           user.o
cd.o           features       filesys.o      user.lsp       work-elements
0

>(help 'system)
-----------------------------------------------------------------------------
SYSTEM                                                             [Function]

Args: (string)
KCL specific: Executes a Shell command as if STRING is an input to the Shell.
Not all versions of KCL support this function.
-----------------------------------------------------------------------------

It works for me on akcl 1.605 for Unix and the current beta release
akcl for dos.

Gordon.
From: Juergen Wagner
Subject: Re: run-program in kcl
Date: 
Message-ID: <1992Aug17.075945.28178@Csli.Stanford.EDU>
I haven't checked this in vanilla KCL but at least AKCL 1.609 supports the
following functions (one runs a process simply for its side-effect, the other
gets you a pipe, i.e., an i/o stream):

>(describe 'system) (describe 'run-process)

SYSTEM - external symbol in LISP package
-----------------------------------------------------------------------------
SYSTEM                                                             [Function]
 SYSTEM
Function in LISP package:
Args: (string)
KCL specific: Executes a Shell command as if STRING is an input to the Shell.
Not all versions of KCL support this function.

-----------------------------------------------------------------------------

RUN-PROCESS - internal symbol in USER package RUN-PROCESS
Function in the SI package:
Args: (string)

Execute the command STRING in a subshell and return a two way stream
associated to this.    Use si::fp-output-stream to get an associated
output stream or si::fp-input-stream.
Bugs:   It does not properly deallocate everything,
so that it will fail if you call it too many times.

-----------------------------------------------------------------------------

--Juergen Wagner
········@iao.fhg.de
·······@csli.stanford.edu
From: Tushar Saxena
Subject: Re: run-program in kcl
Date: 
Message-ID: <1992Aug17.170840.8106@cs.albany.edu>
OK, For run-program counterpart in kcl I got the following two functions
to work with :

1] run-process - My version of kcl (1.599) does not support it.

2] exclp - I have not yet checked it.

As far as "system" is concerned, it will surely not work. I need a stream
for input and output. This is not possible with system.

About the -load option, I really need that, but do not know how to do
it. Solve the following problem for me :

I want to have some way of loading some file before I get into kcl.
Note that init.lsp will not work because that will always load the
same file. You can say that I can change the init.lsp file, but I
am calling kcl through another program using rsh, and at various
points in the program, I want different files to be loaded!

If the above makes sense, please reply.

ttfn
	-Tush.

--------------------------------------------------------------------------------
And any fool knows a dog needs a home, A shelter from pigs on the wing.
        -Roger Waters
--------------------------------------------------------------------------------
email : ······@cs.albany.edu                        Computer Science Department
Phone : 518-442-3388				    SUNY Albany
Tushar Saxena					    Albany NY 12222 (USA)
--------------------------------------------------------------------------------
From: Tushar Saxena
Subject: Re: run-program in kcl
Date: 
Message-ID: <1992Aug17.171103.8160@cs.albany.edu>
OK, For run-program counterpart in kcl I got the following two functions
to work with :

1] run-process - My version of kcl (1.599) does not support it.

2] exclp - I have not yet checked it.

As far as "system" is concerned, it will surely not work. I need a stream
for input and output. This is not possible with system.

About the -load option, I really need that, but do not know how to do
it. Solve the following problem for me :

I want to have some way of loading some file before I get into kcl.
Note that init.lsp will not work because that will always load the
same file. You can say that I can change the init.lsp file, but I
am calling kcl through another program using rsh, and at various
points in the program, I want different files to be loaded!

If the above makes sense, please reply.

ttfn
	-Tush.

--------------------------------------------------------------------------------
And any fool knows a dog needs a home, A shelter from pigs on the wing.
        -Roger Waters
--------------------------------------------------------------------------------
email : ······@cs.albany.edu                        Computer Science Department
Phone : 518-442-3388				    SUNY Albany
Tushar Saxena					    Albany NY 12222 (USA)
--------------------------------------------------------------------------------