-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 27-May-07, at 3:31 PM, Guillaume Germain wrote:
You could do something like:
(read-line (open-process "ls") #f)
And if you need to interact several times with the program over stdin/ stdout you can do something like this:
(define bc (open-process "bc")) (display "1+2\n" bc) (force-output bc) (read-line bc)
"3"
(display "3*4\n" bc) (force-output bc) (read-line bc)
"12"
(close-port bc) (process-status bc)
0
"bc" is the Unix arbitrary precision calculator. If maple can also interact over stdin/stdout then this would be an appropriate interface.
If you want to do this with other Scheme implementations, check out the "processio" Snow package (http://snow.iro.umontreal.ca/? viewpkg=processio).
Marc