dev-serveez
[Top][All Lists]
Advanced

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

[dev-serveez] help: guile


From: stefan
Subject: [dev-serveez] help: guile
Date: Thu, 19 Jul 2001 17:59:52 +0200 (CEST)

Hello list,

Playing around with the guile echo server I got some question:

 * How do I define local variables in procedures ?
   In the following example I want `ret' to be local and not global.

=================================================================
(define (echo-handle-request sock request len)
  (define ret '())
  (if (and (>= (binary-length request) 4) 
           (= 0 (binary-search request "quit")))
    (set! ret -1)
    (begin
      (svz:sock:print sock (binary-concat 
        (string->binary "Echo: ") request))
      (set! ret 0)))
  ret)
=================================================================

 * How do I tell guile to return from a procedure with a certain value ?
   Also in the given example it could be nice to break somewhere in the
   procedure with a given return value. The only possibility I know until
   now is to write the return value at the end of the procedure...

 * Could you Martin please think of another (more complex) example for a
   guile server if have some spare time ?

I just implemented the SMOB I recently discussed with you. It is fairly
documented under "Writing servers -> Guile servers". Would like you to
have a look at... since you're the master of guile.

Thanks in advance,
        address@hidden




reply via email to

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