Hi there Alessandro!
There's a diagram of this in the Introduction to newLISP, which may help. My understanding is based on that diagram... :)
pipe returns a list of two numbers, one for the input or read channel, and one for the output or write channel, for a process. These are the 'handles' to the pipe, which you can use later in
read/write functions.
You have to set up two pipes. though, one to go from newLISP to the bc process (newLISP writes, bc reads), and one for the opposite way (newLISP reads, bc writes). So there are two pipe operations. The process function lets you provide two pipes...
And
map is able to work on two or more lists, so it can set two symbols at the same time, if a list of two values is also provided, which it is here.
So this code:
Code: Select all
(map set '(myin bcout) (pipe))
(map set '(bcin myout) (pipe))
sets four symbols, allowing you to read and write - via two pipes - to a single process (not yet started).
I think... :)
And I posted the same time as Norman.. :)