From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: unknown location: definition in expression context in subform optname-from of "_^" Date: Sun, 29 Jan 2012 16:32:28 -0500 Message-ID: <87y5sqjitv.fsf@netris.org> References: <4F20CEE7.4000403@gmail.com> <1327551746.85660.YahooMailNeo@web37907.mail.mud.yahoo.com> <4F21BFFC.8040300@gmail.com> <87d3a6ovhs.fsf@netris.org> <4F21F635.4020404@gmail.com> <8762fxq3rr.fsf@netris.org> <4F220F84.5090601@gmail.com> <4F221BD3.8090105@gmail.com> <87r4ykl36k.fsf@netris.org> <87obtnzm2p.fsf@pobox.com> <87d3a3lid6.fsf@netris.org> <87k44bzb7l.fsf@pobox.com> <878vkrkuz7.fsf@netris.org> <87aa56z21j.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1327872858 21130 80.91.229.3 (29 Jan 2012 21:34:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2012 21:34:18 +0000 (UTC) Cc: Bruce Korb , guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jan 29 22:34:13 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RrcNx-0000rE-Gx for guile-devel@m.gmane.org; Sun, 29 Jan 2012 22:34:05 +0100 Original-Received: from localhost ([::1]:60859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrcNw-0003WD-WE for guile-devel@m.gmane.org; Sun, 29 Jan 2012 16:34:04 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrcNq-0003Vv-E2 for guile-devel@gnu.org; Sun, 29 Jan 2012 16:34:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrcNm-0005JF-FW for guile-devel@gnu.org; Sun, 29 Jan 2012 16:33:58 -0500 Original-Received: from world.peace.net ([96.39.62.75]:46135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrcNm-0005Fs-C0 for guile-devel@gnu.org; Sun, 29 Jan 2012 16:33:54 -0500 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1RrcNW-0005Xk-Ji; Sun, 29 Jan 2012 16:33:38 -0500 In-Reply-To: <87aa56z21j.fsf@pobox.com> (Andy Wingo's message of "Sun, 29 Jan 2012 21:28:24 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13736 Archived-At: Andy Wingo writes: > Keyword arguments suit this task much better. Okay, I have a fresh idea for your consideration. Let's provide a more general facility to make keyword arguments more convenient to use from C, while avoiding repeatedly interning them. I propose a new macro SCM_KEYWORD, which would be defined something like this: #ifdef __GNUC__ # define SCM_KEYWORD(name) \ ({ static SCM keyword = SCM_BOOL_F; \ if (SCM_UNLIKELY (scm_is_false (keyword))) \ keyword = scm_from_utf8_keyword (#name); \ return keyword; }) #else # define SCM_KEYWORD(name) scm_from_utf8_keyword (#name) #endif Furthermore, at some point in the future we could provide an optional alternative mechanism, where SCM_KEYWORD would expand into a simple global variable reference, and we'd provide a snarfing script to scan the sources for SCM_KEYWORD and produce an initialization routine for all these global keywords. It might be good to do something similar for looking up and caching scheme procedures as well. What do you think? Mark