unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* eval and exceptions
@ 2008-08-10 17:34 Cedric Cellier
  2008-08-11  7:26 ` Maciek Godek
  0 siblings, 1 reply; 4+ messages in thread
From: Cedric Cellier @ 2008-08-10 17:34 UTC (permalink / raw)
  To: guile-user

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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-13 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-10 17:34 eval and exceptions Cedric Cellier
2008-08-11  7:26 ` Maciek Godek
2008-08-11  9:17   ` cedric cellier
2008-08-13 10:32     ` Maciek Godek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).