On 5/23/07, Jussi Eloranta <Jussi.Eloranta at csun.edu> wrote:
> s:openr("/dev/stdin");
> t:readline(s);
> print("entered = ", t);
> closer(s);
>
> At least I could find any info on what streams are open by default
> (pointing to stdin / stdout etc.), so I decided to open one.
> This works well with maxima but wxmaxima seems to get stuck in this (and
> so does xmaxima). It does not seem to know when the input is finished.
Probably WxMaxima and XMaxima don't work because they reassign
stdin and stdout to sockets to communicate with the back end.
> Any other ways to do this?
There is a Maxima function read to read and evaluate an expression
from the console (and readonly to read it and not evaluate it).
There are low-level Lisp functions DBM-READ and SCAN-ONE-TOKEN-G
(not sure about the names). I forget how these differ.
> I suspect that windows would have trouble
> with this as /dev/stdin is not a well defined file there...
Right, it will not work in Windows.
At this point I think we need to back up. Maybe you can remind us
what your larger goal is here.
Sorry I can't be more helpful,
Robert Dodier