dev-serveez
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [dev-serveez] Guile Servers


From: stefan
Subject: Re: [dev-serveez] Guile Servers
Date: Tue, 24 Jul 2001 17:41:26 +0200 (CEST)

On Mon, 23 Jul 2001, Martin Grabmueller wrote:

> I have used another method, and I hope it works.  It does for Guile
> 1.5 and later, it would be nice if you could test it with 1.4 (which I
> don't have around.)  I have attached the merged version for testing.

Well, I put "eval-server.scm" into CVS although it does not yet work
properly on guile-1.4. It always drops into the exception part...

---
bono ~> telnet localhost 2001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Hello, type `quit' to end the connection.
Type Scheme expression to see them evaluated (but only one-liners.)
eval: (+ 1 1)
Exception ~s
eval: quit
Connection closed by foreign host.
bono ~> 
---

> >  * make greeting message, prompt and "quit button" configurable
> 
> By `configurable', do you mean via `define-server!', or by simply
> setting variables?  If the former, you will have to explain how to do
> that.

This means to make it configurable via "define-server!". You can put
configuration items into the definition by:

  (configuration   . (
    (prompt       . (stringr #t "eval: "))
  ))

Then you can get it in your routine by 

  (svz:server:config-get server "prompt")

whereas "server" is either the server or socket argument in the sub 
routine. If you defined a configuartion item this way you can write:

  (define-server! 'eval-server '(
                                 (prompt . "guile> ")
                                 ))

This will override the default value "eval: "... If you have any more
specific questions please tell me.

Cheers,
        address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]