[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: awg-mod_lisp: mod_lisp for R5RS Scheme
From: |
R. Mattes |
Subject: |
Re: awg-mod_lisp: mod_lisp for R5RS Scheme |
Date: |
Tue, 20 Sep 2005 16:26:04 +0200 |
On Tue, 2005-09-20 at 08:06 -0400, Alan Grover wrote:
> R. Mattes wrote:
> > Alan, there seem to be a vew bugs in this code.
>
> Thank you for finding & reporting them. Fixed in latest release.
>
> > First, the guile-specific module contains '(use-modules (awg debug))'
> > and a commented-out trivial debugging version. Since you don't
> > distribute your debugging module with the code it might be better to
> > have the 'use-module' part commented out and the trivial debugging
> > function enabled.
>
> I opted to include my debug module.
>
> > Second: i don't understand the following:
> >
> > (let* (
> > (fn-name (or (and (pair? argv) (car argv) "once")))
> > ....
> >
> > Isn't there a second argument to 'or' missing?
> > In the context of your sample code this always evals to "once".
>
> The 'and was only supposed to have two arguments, making "once" the default.
>
> > Kind of frustrating since the daemon only handles one request
> > and your suggested test
> >
> > ( sleep 1 ; wget -q -t 1 --post-data "post-data&foryou" ...
> >
> > fails.
>
> By "fails", I assume you mean because of the awg-debug module.
No - since your '(or (and' construct always evaluates to "once"
the server only answers _one_ request and the exits.
> Try with "thread", and the test daemon should keep listening now.
Probably not since fn-name will always be "once". BTW, there seems
to be a bug with the argument handling as well: your code defines
main with a 'rest' argument. The command line args are passed in as
a list already so you end up with a list-o-list.
So 'args' ends up being '(("mod_lisp-for-guile.scm" "thread"))'.
Note also that the first member of args is the program name.
So you need to change
(define (main .args) .. => (define (main args) ...
and (car args) => (cadr args)
HTH Ralf Mattes