Raul pointed out:

>If I understand what you've provided, we'd have to
>have this the other way around, such that the chess
>program spawns an instance of J, and interacts
>with it?

Whoops, my mistake.  I did not read the thread in detail; I took it for another 
instance of the "prompt the user" FAQ.  Apologies.  

To implement a LPER (the other side of a REPL), the first idea that occurs to 
me is to use inetd.  That is, configure /etc/services and /etc/inetd.conf to 
bind a local port, which, when it gets a connection, spawns an instance of the 
chess program, and connects the new socket to its stdin & stdout.  Then, in J, 
connect to that port with an asynchronous socket.

The approach has the advantage of being pure J (and that the message delimiters 
aren't limited to newlines).  The drawback is that Windows doesn't have inetd, 
so you'd have to install Cygwin and the appropriate packages.


-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to