chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Matchable not working in module


From: Evan Hanson
Subject: Re: [Chicken-users] Matchable not working in module
Date: Wed, 05 Mar 2014 18:36:55 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Firefox/17.0 Icedove/17.0.10

On 05/03/14 16:39, Matt Gushee wrote:
> However, I'm now getting a compile error like this:
>
> :  Warning: reference to possibly unbound identifier `ofs' in:
> :  Warning:    failure527
>
> :  Error: module unresolved: cav-web-fcgi
>
> I am using 'match' from the matchable egg to dispatch requests, like this:
>
> : (match spec
> :       [(or ((/ "") "GET" #f) ((/ "articles") "GET" #f))
> :           (send-html (get-article-list-page/html out: #f))]
> :       [(or ((/ "") "GET" #f) ((/ "articles") "GET" ofs))
> :           (send-html (get-article-list-page/html out: #f offset:
> (string->number ofs)))]
>
> ... and so on. So 'ofs' is a variable in the pattern match.

`ofs` is only present in the second arm of the `(or ...)` pattern, so
I'm guessing this is due `ofs` being unbound in the expansion of the
first alternative. It's as if you had said:

    (match a
      ((or #f x) x))

... Which will hopefully signal a similar error (hopefully --
untested!). This probably only worked before due to the forgiving nature
of the top level (which is hopeless, and so on). Anyway, try refactoring
the `match` clause to bind `ofs` in all cases and see if that helps.

Cheers,

Evan



reply via email to

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