From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: rm@fabula.de Newsgroups: gmane.lisp.guile.devel Subject: Re: scm_* API extension? [was] scm_* API question Date: Thu, 1 Aug 2002 12:10:15 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <20020801101015.GD7425@www> References: <20020730121436.GA4465@www> <20020730200929.A18106@kiwi.pyrotechnics.com> <20020731100300.GC5661@www> <20020731182124.GD6561@www> <87ado7a794.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1028195972 2851 127.0.0.1 (1 Aug 2002 09:59:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 1 Aug 2002 09:59:32 +0000 (UTC) Cc: rm@fabula.de, Marius Vollmer , guile-devel@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17aCjy-0000js-00 for ; Thu, 01 Aug 2002 11:59:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17aCkV-0007rm-00; Thu, 01 Aug 2002 06:00:03 -0400 Original-Received: from www.elogos.de ([212.18.192.92]) by fencepost.gnu.org with smtp (Exim 3.35 #1 (Debian)) id 17aCjV-0007n5-00 for ; Thu, 01 Aug 2002 05:59:01 -0400 Original-Received: by www.elogos.de (Postfix, from userid 5001) id CAA731049A2; Thu, 1 Aug 2002 12:10:15 +0200 (CEST) Original-To: Rob Browning Content-Disposition: inline In-Reply-To: <87ado7a794.fsf@raven.i.defaultvalue.org> User-Agent: Mutt/1.3.24i Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:912 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:912 On Wed, Jul 31, 2002 at 04:59:35PM -0500, Rob Browning wrote: [ nice samples removed ] > > etc. There's also a module-ref function and a module-use! function... I konw these, but this is all done from the scheme side. I just want to be able to do the same cool things from C (other than scm_call_*ing the functions from (ice-9 safe) etc.). > > 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. > > Well that may or may not be the right thing to do if you're *just* > using the module system for the caching. In that case, you may be > better off to implement the caching yourself (via a hash table or > whatever) and leave the module system to more static modules. No, cacheing is just a (very) nice side effect. My main rationale is the namespace encapsulation. In general i think these modules should be considered static -- during the lifetime of a server the code for a handler shouldn't change. I put things like 'GuileBind ... ' into the handler's module since i haven't understood how to do the same with environments so far. > For example, depending on what you're wanting to do, you might want to > allow different requests to be handled inside separate namespaces, > though they're all using a common set of code. OTTOMH, I think you > could do this by putting the common functionality into a module, say > foo.scm, then doing something like this for *each* request: > > (use-modules (foo)) > (define foo-module (resolve-module '(foo))) > > ;; For each request... > (define next-request-envt (make-safe-module)) ^ ^ | | *----------------* | Does this mean: module <=> environment in guile? > (module-use! next-request-envt (module-public-interface foo-module)) > (define request-form (list handler-sym current-url-string)) > (eval request-form next-request-envt) > > Marius, etc. Please correct any inaccuracies above -- I'm just going > from what I've gathered while poking around. I suspect we need more > thorough documentation of the acceptable usage of the anonymous module > stuff. Would be highly welcome ;-) Ralf _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel