From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: make-module question. Date: Mon, 06 Sep 2010 13:25:06 +0200 Message-ID: References: <4C61A7C4.4030302@hulin.org.uk> <8739ucnhly.fsf@gnu.org> <4C6C5225.1010806@hulin.org.uk> <4C82B5D1.60707@hulin.org.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1283785973 15172 80.91.229.12 (6 Sep 2010 15:12:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Sep 2010 15:12:53 +0000 (UTC) Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , guile-user@gnu.org To: Ian Hulin Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Sep 06 17:12:46 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OsdNE-0003G3-Nu for guile-user@m.gmane.org; Mon, 06 Sep 2010 17:12:45 +0200 Original-Received: from localhost ([127.0.0.1]:56484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsdND-0004Fs-SM for guile-user@m.gmane.org; Mon, 06 Sep 2010 11:12:43 -0400 Original-Received: from [140.186.70.92] (port=47194 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OsdMc-0004BQ-VH for guile-user@gnu.org; Mon, 06 Sep 2010 11:12:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OsdMa-0003QW-F8 for guile-user@gnu.org; Mon, 06 Sep 2010 11:12:06 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:43318 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OsdMa-0003KR-DG; Mon, 06 Sep 2010 11:12:04 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 51DA5D3F5B; Mon, 6 Sep 2010 11:11:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=+xeYSDNUpvCMKBB7uQ60k/nOkKk=; b=pEePnA qsIGEU8JDZQHLvZMBA4+/bCpu9bAKvGE909HGstE5fTeNszds6K4BSjamPCdoMVm PQ7S9p2OsWbWR6e8PtrEp9+C1naGTv+vAYFLbKKTMmG9iRiwECaM+UmeA6jCvjC2 OS0EVMTcMvS6Qn+8EedoJOPcqLBP9fH10YM6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=M1g58dtPHvBJyjRdQADf162XaILLuTPu Yr/myW7Yq9U45/ICeZxtgS1lOKY/aN/ssT5DeLEnk3HIDrMgbN12bgtNf6nya56w sHBkAlUdt8ji8GozE6U17RKuiVVhid0pJ87vzwvFcSkF/Sukgm9v4t2gXk6DAjI0 3NSXfjNSpJA= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 2DF8DD3F58; Mon, 6 Sep 2010 11:11:24 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [79.156.147.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 131B1D3F45; Mon, 6 Sep 2010 11:11:20 -0400 (EDT) In-Reply-To: <4C82B5D1.60707@hulin.org.uk> (Ian Hulin's message of "Sat, 04 Sep 2010 22:10:41 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 036F5272-B9C9-11DF-B129-030CEE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:8161 Archived-At: Hello, On Sat 04 Sep 2010 23:10, Ian Hulin writes: > If #:key is a superset of #:optional #:key is not a superset of optional. Keyword parameters are bound by name; optional parameters are bound by position. Keyword parameters are not bound by position. ((lambda* (#:optional foo) foo) 10) => 10 ((lambda* (#:key foo) foo) 10) => Error. > If this is the case, could I request an enhancement for this the base > code to declared using > (define* (make-module #:key (size 31) (uses '()) (binder #f)) > ...) Unfortunately we cannot, as this would be an incompatible change. > If make-module is declared using #;key, how would this affect calling it > from code with scm_call_1, scm_call_2, scm_call_3 or scm_call_n? > SCM keyname = scm_str2symbol ("#;uses"); In modern Guile (>= 1.8), one makes a symbol from a string via scm_from_locale_symbol. However in this case you want to make a keyword, so use scm_from_locale_keyword ("uses"). (Actually, we should be using scm_from_latin1_keyword here, but that doesn't exist yet.) > SCM modlist = scm_list_2 (scm_str2sym("ice-9 syncase"), > scm_str2sym("ice-9 debug")) Neither of these modules are needed in current Guile. scm_str2sym is not a part of Guile either; assuming it is one of your functions, you should use your own namespace (ly_ for example), not Guile's (scm_). > scm_call_2( SCM_VARIABLE_REF (scm_make_module_x), keyname, modlist): Yes, you would call it like this. Regards, Andy -- http://wingolog.org/