guile-devel
[Top][All Lists]
Advanced

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

Re: scm_* API extension? [was] scm_* API question


From: rm
Subject: Re: scm_* API extension? [was] scm_* API question
Date: Wed, 31 Jul 2002 20:21:24 +0200
User-agent: Mutt/1.3.24i

On Wed, Jul 31, 2002 at 12:10:19PM +0200, Marius Vollmer wrote:
> address@hidden writes:
> 
> > Would it be usefull to provide a scm_* function for it?
> 
> Yes.  I will add this to CVS.
> 
> However, I'd say it is better to code all module system manipulations
> in Scheme and try to keep the C code 'module system ignorant' if that
> is possible.
> 
> 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. Hmm, i guess this sounds rather confusing, so
here is a small example. I the server configureation on can do the following:

<Location /cool/stuff>
  SetHandler             guile-handler
  GuileContentHandler    (web linkdatabase cool)
</Location>

<Location /biblio>
  SetHandler             guile-handler
  GuileContentHandler    (web apps biblio)
</Location>

Whenever a request for http://localhost/biblio comes in the
webserver invokes the 'handler' method from the module (web apps biblio).
Ah, in case one wants a different name, 'GuileContentHandler' will also
accept a pair of the form '(module-spec . handler)' that allows us to 
specifiy the name of the function that gets invoked (and hence we can define
more than one handler within one module). 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. As a side note: as a quick hack i put the symbol into
the module but i'd rather like to use something like an environment i can
set up myself (i hope setting up an environment isn't to expensive performance
wise), but i have way too little understanding about how to do this right now.
But it would make a _way_ cool web environment -- full control over the env.
means secure execution as well as probably some nice passing on of context.

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.

 Ralf Mattes

> _______________________________________________
> Guile-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/guile-devel



reply via email to

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