Hi Alistair,
On Sat, Apr 7, 2018 at 12:32 PM, Alistair Grant akgrant0710@gmail.com wrote:
On 7 April 2018 at 20:29, K K Subbu kksubbu.ml@gmail.com wrote:
On Saturday 07 April 2018 08:14 PM, Eliot Miranda wrote:
$ cd image $ ./buildspurtrunkreaderimage.sh $ myvm spurreader.image squeak> 3 + 4! 7 squeak> Smalltalk quit!
Nice. This can become a good smoke test at the end of the build*.sh:
/bin/echo -e '14*3!\nSmalltalk quit!' | $VM spurreader.image
Now there's the answer to life, the universe and everything ;-)
Regards .. Subbu
Interesting idea... But even the old VM doesn't provide the answer.
It will do, but that \n must be a ^M. So if one types '3+4! followed by ctrl-v carriage return, followed by Smalltalk quit!' then echo will echo a carriage return. But since the REPL is actually reading chunk format (hence the !'s) one doesn't need the carriage return at all and one should be able to say
echo '3+4!Smalltalk quit!' | $VM spurreader.image
and see "squeak> 7 squeak> " printed to stdout
Piped input is working in general with my new test VM. I'll have to
figure out why the reader image doesn't handle it.
I think the details are in the nextChunkNoTag method in the CogTools-Listener package. I was trying to do the simplest thing that could possibly work here, not produce a usable listener. The ! requirement is absurd for general use but acceptable for someone simply wanting to exercise (potentially non-blocking) reading from stdin.
_,,,^..^,,,_ best, Eliot