LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2014, 10:08 PM   #1
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
common lisp: calling external programs


Hi. In a Common Lisp program, I want to launch an external program, and then connect to the other program's stdin/stdout streams. Is launching an external program an implementation dependent thing, or is there a standard function I am looking for?
 
Old 01-26-2014, 01:15 AM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
In the Linux distro. I'm using it works like this:
Code:
clisp -x '(EXT:EXECUTE  "/usr/bin/echo" "barf" )'
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010

Type :h and hit Enter for context help.

barf
NIL
Bye.
In the implementation on the Linux distro. I use, if I point my browser at

Code:
/usr/share/doc/packages/clisp/doc/impnotes.html
and page down past the revision history, I get an actual manual that I
can go through describing the current implementation. Since this is a
non-*NIX Forum, if you're not using Unix/Linux or something compatible,
you might look for just the impnotes file somewhere in the directory
hierarchy of the clisp installation.

In fact, the first 28 chapters of that manual seem to be just the chapters from:

CommonLisp Spec. at MIT

Chapter 32 covers Platform Specific Extensions, including executing
an external command in a shell. So if that's the sort of think you
mean by an "external program", and what's "Platform Specific" is
what you'd consider "implementation dependent", then it's
implementation dependent. Otherwise, if you're talking about
just connecting two clisp programs to one another, I believe you
might be able to accomplish that with the standard Stream stuff,
Chapter 21.

HTH.
 
1 members found this post helpful.
Old 01-26-2014, 01:54 AM   #3
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467

Original Poster
Blog Entries: 60

Rep: Reputation: 51
Thanks. I looked at my local SBCL documentation, and saw it had a extension function sb-ext:run-program, with key arguments for setting the input and output streams for the launched process. This seems satisfactory for me, though I imagine there is probably some quicklisp library out there that makes this portable across compilers.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Common lisp question. Alejandro_Zamora Programming 1 11-10-2013 05:34 PM
Common Lisp functions. zaxonus Programming 2 07-09-2010 04:30 PM
can I make C + common lisp simpler than C alone? ta0kira Programming 7 03-08-2009 10:56 PM
Calling external programs to FTP from C program Manish Programming 11 04-03-2005 10:53 PM
QT newbie - calling external programs squinn Programming 1 03-24-2005 10:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration