From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: User perception on backward compatibility Date: Thu, 21 Jan 2010 20:14:40 +0000 Message-ID: <87my072p1r.fsf@ossau.uklinux.net> References: <87y6jrzq10.fsf@gnu.org> <87eiljiq7s.fsf@ambire.localdomain> <87fx5zv8gu.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1264105029 32296 80.91.229.12 (21 Jan 2010 20:17:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2010 20:17:09 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 21 21:17:01 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NY3S4-00056X-9F for guile-devel@m.gmane.org; Thu, 21 Jan 2010 21:16:24 +0100 Original-Received: from localhost ([127.0.0.1]:39163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NY3S5-0006Te-8e for guile-devel@m.gmane.org; Thu, 21 Jan 2010 15:16:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NY3RV-00060l-3I for guile-devel@gnu.org; Thu, 21 Jan 2010 15:15:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NY3RQ-0005vf-Bk for guile-devel@gnu.org; Thu, 21 Jan 2010 15:15:48 -0500 Original-Received: from [199.232.76.173] (port=32875 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NY3RP-0005vU-V0 for guile-devel@gnu.org; Thu, 21 Jan 2010 15:15:44 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]:34702) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NY3RN-00045v-TV; Thu, 21 Jan 2010 15:15:42 -0500 Original-Received: from arudy (host86-182-229-157.range86-182.btcentralplus.com [86.182.229.157]) by mail3.uklinux.net (Postfix) with ESMTP id 024BD1F6A98; Thu, 21 Jan 2010 20:15:03 +0000 (GMT) Original-Received: from arudy (arudy [127.0.0.1]) by arudy (Postfix) with ESMTP id 814AD3801F; Thu, 21 Jan 2010 20:14:41 +0000 (GMT) In-Reply-To: <87fx5zv8gu.fsf@gnu.org> ("Ludovic =?iso-8859-1?Q?Court=E8s?= =?iso-8859-1?Q?=22's?= message of "Thu, 21 Jan 2010 15:27:45 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9909 Archived-At: ludo@gnu.org (Ludovic Court=A8=A8s) writes: > Hi, > > Thien-Thi Nguyen writes: > >> At the moment, i would ask you to look at the guile-user message >> w/ subject "(define ((f a) b) ...)". > > I didn=A1=AFt reply on the grounds that Andy may have his views on this. = :-) I think it just needs a bit of define-syntax. As it happens, the definition of define-public has the required form: (define-syntax define-public (syntax-rules () ((_ (name . args) . body) (define-public name (lambda args . body))) ((_ name val) (begin (define name val) (export name))))) and it works: scheme@(guile-user)> (define-public ((f a) b) (* a b)) scheme@(guile-user)> (f 2) # scheme@(guile-user)> ((f 2) 3) 6 But I completely agree that we want `define' to support that too, `out of the box'. What is the correct way of writing something like this in boot-9.scm? (define-syntax primitive-define define) (define-syntax define (syntax-rules () ((_ (name . args) . body) (define name (lambda args . body))) ((_ name val) (begin (primitive-define name val) (export name))))) Regards, Neil