Possibility of executing programs 
Author Message
 Possibility of executing programs

hi,

I asked at comp.lang.pop some time ago whether it was possible to
execute an external program from Poplog and most specifically from
the Common Lisp part but I don't think I got a reply. Is this
possible?

I am thinking of an equivalent to C's system() or as implemented in
other lisp-implementations:
  #+allegro (excl:run-shell-command cmd :wait t)
  #+clisp (lisp::shell cmd)
  #+lispworks (system::call-system cmd)

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



Thu, 02 May 2002 03:00:00 GMT  
 Possibility of executing programs
[To reply replace "Aaron.Sloman.XX" with "A.Sloman"]


Quote:
> Date: 14 Nov 1999 23:50:33 GMT

> hi,

> I asked at comp.lang.pop some time ago whether it was possible to
> execute an external program from Poplog and most specifically from
> the Common Lisp part but I don't think I got a reply. Is this
> possible?

(Almost) Anything you can do in Pop-11 you can do in Poplog Common lisp
with appropriate syntax. The Pop-11 sysobey command takes a string and
runs it as a shell command, so you can do

(pop11::sysobey "who")
    to find out who is logged in

(pop11::sysobey "ls -l")
    to get a directory listing.

For more on SYSOBEY give the REF SYSOBEY command in the editor,
or look at the file $usepop/pop/ref/sysutil

There are additional Pop-11 library facilities accessible via lisp,
e.g. pipein, pipeout, and run_unix_program, useful when you want a
program to communicate with a unix program, e.g. sending it input
or reading output from it, unlike sysobey which simply runs a
complete shell command and prints any output to the terminal: not so
good if you want the output to go into an editor buffer.

There are also facilities for invoking external procedures (e.g.
defined in C, fortran, etc.) and the lisp interface for this is in
the lisp HELP EXTERNAL file, also readable as
    $usepop/pop/lisp/help/external

I am not a lisp user. Maybe someone else will provide more detailed
information.

It is probably a good idea to find your way around the files in
    $usepop/pop/lisp/help/
    $usepop/pop/lisp/ref/

You may also find some of the Pop-11 REF files useful, in
    $usepop/pop/ref/

E.g. system, external, external_data, and many more.

If you start trying to use the X window interface look at files in

    $usepop/pop/x/pop/ref/
    $usepop/pop/x/pop/help/

They describe facilities geared to Pop-11, but accessible from
Poplog common lisp.

Aaron
--
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
EMAIL A.Sloman AT cs.bham.ac.uk   (NB: Anti Spam address)
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/



Fri, 03 May 2002 03:00:00 GMT  
 Possibility of executing programs
Stig asked :-

Quote:
>I asked at comp.lang.pop some time ago whether it was possible to
>execute an external program from Poplog and most specifically from
>the Common Lisp part but I don't think I got a reply. Is this
>possible?

Yes - it is definitely possible.  The "base" language of Poplog is
Pop11 and the typical answer to the question "how do I add an new
capability to Poplog Common Lisp" is use Pop11.

The relevant help file is "help poplisp" (or $usepop/pop/help/poplisp).
The Pop11 "system" capabilities are not, as far as I know, documented
in a single place.  The most general call available is run_unix_program,
the most convenient is sysobey.  Both have their own help files.  Read
"ref sysutil" for background info.

Hope this helps,

Steve



Fri, 03 May 2002 03:00:00 GMT  
 Possibility of executing programs
Lisp has a function RUN-UNIX-PROGRAM - see HELP RUN-UNIX-PROGRAM.

John Williams.



Fri, 03 May 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Programming possibilities...

2. comm ports/shell out from DOS program to execute Windows program

3. executing dos program within program

4. executing program from inside a program

5. Q: Executing programs from within a program

6. Help: Executing lisp programs from C-programs?

7. Determining JES Class for executing program

8. How to execute a command line program in VW

9. VW2.0 Executing other programs (Windows)

10. Executing an external file's assocaited program

11. Executing DOS program from CW1.5

12. Programs to execute from template

 

 
Powered by phpBB® Forum Software