From: Marius Vollmer <marius.vollmer@uni-dortmund.de>
Cc: guile-devel@gnu.org
Subject: Re: scm_* API extension? [was] scm_* API question
Date: 05 Aug 2002 17:08:45 +0200 [thread overview]
Message-ID: <lj4re9ibr6.fsf@burns.dt.e-technik.uni-dortmund.de> (raw)
In-Reply-To: <20020731182124.GD6561@www>
rm@fabula.de writes:
> > Why do you want to perform module system operations from C? Maybe
> > there is a more elegant way.
>
> Ok this is for my current (frankensteinish) hacking with Dave's mod_guile:
> i'm working on implementing a mod_guile mode in which URLs get mapped to
> so-called 'handlers' in modules - meaning i (ab?)use the hierarchical module
> space a namespace enclosures.
That sounds rather reasonable to me. But do you need to invoke
'use-modules' for this?
What I would probably do is to have a single Scheme function that gets
called from C, and perform all the dispatching in Scheme. That
function would be called with different arguments for different
<Location>s.
I suppose, all Apache can really handle in its configuration file are
strings. So I would make my Scheme function take a string as its
argument. When the function wants to interpret that string as a
Scheme form, it can do so. (Calling 'read' from Scheme is no less
efficient than calling it from C, but more convenient.)
Maybe I would even require the Scheme code to register the dispatching
function with the C code before it can be used. That way, the C code
is completely independent from the Scheme code and the interactions
between the too are not via magic names but by explicit API calls.
> I'll also plan to add something like
>
> GuileBind a-symbol '(arbitrary (guile data) structure)
>
> i.e. i want guile to 'read' from the configuration file and bind
> 'a-symbol' to whatever was read.
I think I would pass extra information via the handler callback, not
as a variable, but of course I can't say whether that will be feasible
in your case.
> BTW, one reasons i do use the module system is the impicit cacheing i get:
> a module gets loaded only once, and that does make a difference in response
> time compared to the initial 'eval a file per request' aproach of mod_guile.
I see. mod_guile should probably have a 'call a function per request'
kind of model. That is just as flexible but does not have to be slow.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-08-05 15:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-30 12:14 scm_* API question rm
2002-07-31 1:09 ` Christopher Cramer
2002-07-31 10:03 ` scm_* API extension? [was] " rm
2002-07-31 10:10 ` Marius Vollmer
2002-07-31 18:21 ` rm
2002-07-31 21:59 ` Rob Browning
2002-08-01 10:10 ` rm
2002-08-01 16:51 ` Rob Browning
2002-08-05 15:08 ` Marius Vollmer [this message]
2002-08-05 16:06 ` rm
2002-08-05 16:49 ` Marius Vollmer
2002-07-31 20:06 ` Christopher Cramer
2002-07-31 22:14 ` Rob Browning
2002-08-01 9:41 ` rm
2002-08-05 17:51 ` Marius Vollmer
2002-08-05 18:12 ` Han-Wen Nienhuys
2002-08-05 18:45 ` Rob Browning
2002-08-05 18:31 ` Rob Browning
2002-08-05 18:33 ` rm
2002-08-05 15:12 ` Marius Vollmer
2002-07-31 10:11 ` Marius Vollmer
2002-07-31 10:30 ` rm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=lj4re9ibr6.fsf@burns.dt.e-technik.uni-dortmund.de \
--to=marius.vollmer@uni-dortmund.de \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).