From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ludovic =?iso-8859-1?Q?Court=E8s?= Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.sources Subject: Re: cmod-play 1 available + modsup.h additions Date: Fri, 14 Nov 2003 09:26:58 +0100 Organization: LAAS-CNRS Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <20031114082656.GE14359@powergnu.laas.fr> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068798699 22592 80.91.224.253 (14 Nov 2003 08:31:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2003 08:31:39 +0000 (UTC) Cc: guile-user@gnu.org, guile-sources@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Nov 14 09:31:36 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AKZMd-00084P-01 for ; Fri, 14 Nov 2003 09:31:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AKaGq-00017d-JT for guile-user@m.gmane.org; Fri, 14 Nov 2003 04:29:40 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AKaGE-00014a-0E for guile-user@gnu.org; Fri, 14 Nov 2003 04:29:02 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AKaFh-0000Ej-IQ for guile-user@gnu.org; Fri, 14 Nov 2003 04:29:00 -0500 Original-Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AKaFg-0000Co-R9; Fri, 14 Nov 2003 04:28:29 -0500 Original-Received: by laas.laas.fr (8.12.10/8.12.10) with SMTP id hAE8QxAi009501; Fri, 14 Nov 2003 09:27:00 +0100 (CET) Original-To: ttn@glug.org Mail-Followup-To: ttn@glug.org, guile-sources@gnu.org, guile-user@gnu.org Content-Disposition: inline In-Reply-To: X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://ludo.humanoidz.org/ludovic.asc X-OS: GNU/Linux X-URL: http://ludo.humanoidz.org/ User-Agent: Mutt/1.5.4i [Guile enabled] X-Spam-Score: -5 () EMAIL_ATTRIBUTION, IN_REP_TO, QUOTED_EMAIL_TEXT, REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_MUTT X-Scanned-By: MIMEDefang at CNRS-LAAS X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2381 gmane.lisp.guile.sources:76 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2381 Hi, The naming style of the macros in modsup.h doesn't seem to be very consistent with the rest of the API. In particular, macros are not defined in the SCM_ namespace and their name are pretty concise (abbreviations, no underscores in between words, etc.). Am I missing something? Also, will this be part of Guile 1.6.x too? Thanks, Ludovic. Yesterday, 10 hours, 25 minutes, 3 seconds ago, Thien-Thi Nguyen wrote: > folks, > > libtool modules cannot depend on other libtool modules (according to the > documentation on libltdl), so we can't co-opt that strategy if we want > to design compiled modules that depend on other modules. sure, we can > throw up our hands and relegate everything to the system linker/loader, > but why pass up a thorny question for others to play with? i mean, to > do system programming you need to grab control of the system, and to do > module system programming you need to grab control of the module system. > > so, this message actually presents two pieces of source code: (1) a > pointer to the documented exploratory process: > > http://www.glug.org/people/ttn/software/cmod-play/ > > and (2) a request for comments on the tentative conclusions of the above > exploration, as expressed by the additional interface > elements excerpted below. if All Goes Well, they will appear in guile > 1.4.1.97. > > in other news, i will be using this new support immediately for > guile-sdl compiled modules (the motivation for all this, you see), so to > spare everyone the agony guile-sdl will not be released until 1.4.1.97 > is out. (however, everything works swimmingly from cvs, if you are > feeling adventurous. :-) > > thi > > _____________________________________________________________ > /*:Return the @var{obj} given, but marked as "permanent". > This means that it can never be garbage collected. > */ > #define GHSTONED(obj) \ > scm_permanent_object (obj) > > /*:Declare and later arrange for @var{cvar} (type SCM) to hold a resolved > module object for @var{fullname}, a C string such as "(ice-9 q)". The > string is saved in a C variable named by prefixing "s_" to @var{cvar}. > You must use @var{cvar} as the second arg to @code{MUSEMODULEVAR}. > */ > #define MUSEMODULE(cvar,fullname) \ > SCM_SNARF_HERE (static char * s_ ## cvar = fullname; static SCM cvar) \ > SCM_SNARF_INIT (cvar = GHSTONED (gh_resolve_module (s_ ## cvar));) > > /*:Declare and later arrange for @var{cvar} (type SCM) to have the > same value as the imported module @var{m_cvar} variable @var{s_name}. > @var{m_cvar} is the SCM object declared with @code{MUSEMODULE}, and > @var{s_name} is a string such as "q-empty?". If the imported value > is a procedure, you can use @code{gh_apply} or @code{gh_call0} through > @code{gh_call3} on it. > */ > #define MUSEMODULEVAR(cvar,m_cvar,s_name) \ > SCM_SNARF_HERE (static SCM cvar) \ > SCM_SNARF_INIT (cvar = GHSTONED (gh_module_lookup (m_cvar, s_name));) > > /*:Declare and define a procedure @var{cvar} that takes 0 (zero) args, > which returns the result of calling @code{gh_call0} on @var{proc_cvar}. > @var{proc_cvar} is the SCM object declared with @code{MUSEMODULEVAR}. > */ > #define MUSEMODULEPROC0(cvar,proc_cvar) \ > static SCM cvar (void) \ > { return gh_call0 (proc_cvar); } > > /*:Declare and define a procedure @var{cvar} that takes 1 (one) SCM arg, > which returns the result of calling @code{gh_call1} on @var{proc_cvar} > and this arg. @var{proc_var} is the SCM object declared with > @{MUSEMODULEVAR}. > */ > #define MUSEMODULEPROC1(cvar,proc_cvar) \ > static SCM cvar (SCM a1) \ > { return gh_call1 (proc_cvar, a1); } > > /*:Declare and define a procedure @var{cvar} that takes 2 (two) SCM args, > which returns the result of calling @code{gh_call2} on @var{proc_cvar} > and the args. @var{proc_var} is the SCM object declared with > @{MUSEMODULEVAR}. > */ > #define MUSEMODULEPROC2(cvar,proc_cvar) \ > static SCM cvar (SCM a1, SCM a2) \ > { return gh_call2 (proc_cvar, a1, a2); } > > /*:Declare and define a procedure @var{cvar} that takes 3 (three) SCM args, > which returns the result of calling @code{gh_call3} on @var{proc_cvar} > and the args. @var{proc_var} is the SCM object declared with > @{MUSEMODULEVAR}. > */ > #define MUSEMODULEPROC3(cvar,proc_cvar) \ > static SCM cvar (SCM a1, SCM a2, SCM a3) \ > { return gh_call3 (proc_cvar, a1, a2, a3); } > > [modsup.h excerpt ends here] > > > _______________________________________________ > Guile-user mailing list > Guile-user@gnu.org > http://mail.gnu.org/mailman/listinfo/guile-user _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user