Hi Arie,
> when (e.g.) executing this code in a terminal, which expects typed input, I
> can't manage to simulate an EOF in the terminal:
>
> (until (eof)
> (prinl (glue " " (flip (split (line) " ")))) )
This is not possible. Standard input cannot be closed, and then continued in the
REPL. How would you type anything?
> I know this should be possible (in Linux) by using ctrl+d.
> However, this forces PicoLisp to a halt!
Yes. Also in Unix does a ^D terminate the program (eg. 'cat').
Note that Unix and also PicoLisp don't have a EOF *character* like DOS or
Windows (^Z).
Typing ^D on the command line in bash or PicoLisp or whatever is just just a
convention, and handled in the way that standard input is closed.
You need some convention how to stop the loop, eg.
(while (line)
(prinl (glue ... @ ...)
which will stop on an empty line.
Or, you use some end-marker, like the PicoLisp 'here' function does (or bash
"here" documents).
♪♫ Alex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe