[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
how to link CGI scripts and PLT libraries?
Hi all,
I've been doing several CGI scripts lately, and in a couple of them I
want to use other PLT libraries, so I try to use compound units, link
the appropriate libraries, and import only the cgi^ signature.
Nevertheless, I seem to be missing something, because it won't work.
For instance, suppose I want to use the mail extensions in the net
collection. Further more, suppose the cgi is named `foo', and has the
following:
,--------------------
| (require-library "mails.ss" "net")
|
| (compound-unit/sig
| (import (cgi : cgi^))
| (link [e-mail : mzlib:sendmail^ ((require-library "mailr.ss" "net"))]
| [dispatch : () ((require-library "dispatch" "www") cgi e-mail)])
| (export (open dispatch)))
`--------------------
and of course, dispatch is a unit defined in the www collection like:
,--------------------
| (unit/sig ()
| (import cgi^ mzlib:sendmail^)
|
| ... the CGI thing using send-mail-message/port
| )
`--------------------
Now, if I go to: http://.../cgi-bin/foo, it (almost) work, except that
I cannot use send-mail-message/port, defined? returns #f on it from
within the dispatch unit, huh?
I can't see why this isn't working, or what the Right Way(tm) to do
this kind of stuff is, so any hint would be greatly appreciated.
TIA,
--Francisco