From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Zeeshan Ali Newsgroups: gmane.lisp.guile.user Subject: Re: Module unloading Date: Wed, 25 May 2005 02:26:27 +0500 Message-ID: <38294b7405052414266f95d20a@mail.gmail.com> References: <38294b74050523070378b75caf@mail.gmail.com> <42921E8E.7060503@ossau.uklinux.net> <38294b74050523135563afe3dc@mail.gmail.com> <429249E3.1050604@ossau.uklinux.net> <38294b7405052406021c0ec40f@mail.gmail.com> <42936F3C.3090409@ossau.uklinux.net> <38294b7405052414062801ceba@mail.gmail.com> Reply-To: Zeeshan Ali NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1116970631 28279 80.91.229.2 (24 May 2005 21:37:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 May 2005 21:37:11 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue May 24 23:37:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dah3O-0001kv-JT for guile-user@m.gmane.org; Tue, 24 May 2005 23:35:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dah77-0005NF-9p for guile-user@m.gmane.org; Tue, 24 May 2005 17:39:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dah3b-0003Ti-Mg for guile-user@gnu.org; Tue, 24 May 2005 17:35:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dah3a-0003St-64 for guile-user@gnu.org; Tue, 24 May 2005 17:35:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dah3Z-0003My-VS for guile-user@gnu.org; Tue, 24 May 2005 17:35:22 -0400 Original-Received: from [64.233.170.206] (helo=rproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DagvE-00048r-PT for guile-user@gnu.org; Tue, 24 May 2005 17:26:44 -0400 Original-Received: by rproxy.gmail.com with SMTP id y7so1025111rne for ; Tue, 24 May 2005 14:26:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PqE9beqSoq8eM335YGRqdHxg18SoRwGaS8R1NMu9uP/JBwu55vdXas7YydGWwqRVKxFAf9eefH25MCACfuS9xysx0CvPHHBLkIpSNDDcE1VV2P7pe2kCTHrfNDqgtNLnswIXFP864cbALZj1r0D3QO8nN+6CcBurM+Tcb/YUcBY= Original-Received: by 10.38.150.9 with SMTP id x9mr495299rnd; Tue, 24 May 2005 14:26:27 -0700 (PDT) Original-Received: by 10.38.89.43 with HTTP; Tue, 24 May 2005 14:26:27 -0700 (PDT) Original-To: Neil Jerram In-Reply-To: <38294b7405052414062801ceba@mail.gmail.com> Content-Disposition: inline X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:4577 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:4577 Hello again, > > Why not use a registration > > API instead? In other words, instead of this: > > > > (define (do-plugin-thing-1 ...) ...) > > (define (do-plugin-thing-2 ...) ...) > > ... > > > > do this: > > > > (let () > > (define (do-plugin-thing-1 ...) ...) > > (define (do-plugin-thing-2 ...) ...) > > ... > > (register-plugin do-plugin-thing-1 > > do-plugin-thing-2 > > ...)) This is the code of the plugin right? and register-plugin is a function provided by me for the plugins to call? But i'll still need an entry point inside the plugin: a procedure that i'll call from the module as soon as i load it. So this approach doesn't seem to be of a big advantage. > > This way there is no magic, and the visibility of the plugin bindings i= s > > under the control of the plugin author. I think I have figured-out a way out of this visibility problem: (define amodule (resolve-module '(amodule))) ((variable-ref (module-local-variable amodule 'xchat-plugin-init))) This code seems to work and there is no need for the plugin to export it's objects anymore. > Also, this way you could stay > > pure-R5RS if you like, as you don't really need any features of the > > module system. Wait a sec? Are you really thinking what i think you are thinking: use the simple 'load' procedure combined with your suggested registeration API instead of using the module system of guile? =20 Regards, Zeeshan Ali _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user