Hi you all in there ! In the attempt to drastially reduce the work required for a little project (a small wargame), I want to use guile to "box" the game engine (that is to be) written in C. I also want the players GUI to be connected to the game via sockets established by guile (15 lines of code, 5s for cut and paste from the guile manual, thank you so much !)
To save even more lines of code, I would like the protocol between clients and server to be merely scheme, that is : the client sends some scheme command, like, say : (with-player "Joe" (attack-other-player "Jim")) and the guile main engine reads it and merely eval-string it. The problem is : if the client, because of a bug or an eroneous or malicious user input, sends a string that is not valid scheme, the whole guile engine stops. I would like to be able to catch those parsing errors out of the eval and simply send back an error message to the faulty client, instead of having the whole server to stop. Is there a way to do this, or can you point me toward a better way to achieve my goal ? I must confess I'm new to guile and to scheme, and have not been deep into the manual yet.