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: define-syntax Date: Tue, 9 Dec 2008 20:20:33 +0000 Message-ID: <49dd78620812091220l449cfcffscb791f4590c0ad0@mail.gmail.com> References: <3F715C67433E594B88B5ABEBBC6EE49F03E16E84@fe-mail47.de.bosch.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1228854083 23441 80.91.229.12 (9 Dec 2008 20:21:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Dec 2008 20:21:23 +0000 (UTC) Cc: guile-devel@gnu.org To: "Pach Roman (DGS-EC/ESG3)" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Dec 09 21:22:27 2008 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 1LA969-0003er-5a for guile-devel@m.gmane.org; Tue, 09 Dec 2008 21:22:25 +0100 Original-Received: from localhost ([127.0.0.1]:35984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LA94x-00020G-Sa for guile-devel@m.gmane.org; Tue, 09 Dec 2008 15:21:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LA94u-0001xU-Gr for guile-devel@gnu.org; Tue, 09 Dec 2008 15:21:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LA94t-0001wH-OS for guile-devel@gnu.org; Tue, 09 Dec 2008 15:21:07 -0500 Original-Received: from [199.232.76.173] (port=46047 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LA94t-0001w3-H5 for guile-devel@gnu.org; Tue, 09 Dec 2008 15:21:07 -0500 Original-Received: from mail-bw0-f20.google.com ([209.85.218.20]:43788) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LA94t-0000OH-1J for guile-devel@gnu.org; Tue, 09 Dec 2008 15:21:07 -0500 Original-Received: by bwz13 with SMTP id 13so278012bwz.18 for ; Tue, 09 Dec 2008 12:21:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=lzfrygZ+lZaiPbCUImW9+tGrDXrPBnwKtLlK0vwnTEE=; b=XwJYtyc9KqehOKUjNL5Kf9iau1QoeA8mxRkGw1812CGfd80DwUu50uuJZDRg/gooFH STepI1fzirV9iwA3rsfVGdfHYExR0q9KlGAx4evExNhg/Jo5Zlnp8xRJk+m6qNLZDz1C UMxXDZ4RnorWe104+DGKdSOaOHcbTtmG9XRgo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=s06+ZslX5eAuQfVuKCFG/nzKSt4JSzVpvKOzYGFdAekfXF92t91vXVUSj3ZqG6b4tY FeA1Bbwoi0wzc9CnGTUMxl7xRaZ/Qe+xlb55QecDoKuR1iaLAztjS8oq/ZpqFomNWjR8 hNUhphsYoFu1+9coTAvZZSAwJEnPG7Ib0fjrU= Original-Received: by 10.181.197.6 with SMTP id z6mr148296bkp.213.1228854033680; Tue, 09 Dec 2008 12:20:33 -0800 (PST) Original-Received: by 10.181.59.9 with HTTP; Tue, 9 Dec 2008 12:20:33 -0800 (PST) In-Reply-To: <3F715C67433E594B88B5ABEBBC6EE49F03E16E84@fe-mail47.de.bosch.com> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:7910 Archived-At: 2008/12/9 Pach Roman (DGS-EC/ESG3) : > I've performed following two short tests. > > test 1: > ------- > > (use-syntax (ice-9 syncase)) > > (define-syntax my-macro-1 > (syntax-rules () > ((_ par1 par2 par3) > (begin > (string-concatenate (list par1 par2 par3)) > )))) > > (define (dummy) > (my-macro-1 "a" "b" "c")) > > (format #t "dummy => ~s\n" (procedure-source dummy)) > > result: > dummy => (lambda () (string-concatenate (list "a" "b" "c"))) > > test 2: > ------- > (define-macro (my-macro-2 par1 par2 par3) > (string-concatenate (list par1 par2 par3))) > > (define (dummy) > (my-macro-2 "a" "b" "c") > ) > (dummy) > (format #t "dummy => ~s\n" (procedure-source dummy)) > > result: > dummy => (lambda () "abc") > > It seems to me the define-syntax is broken in version "1.8.2" > or I've done something wrong. These examples both look good to me. Which one do you think is wrong? It may help if I point out that define-macro usage usually involves backquoting. The define-macro version of your define-syntax example would normally be: (define-macro (my-macro-2 par1 par2 par3) `(string-concatenate (list ,par1 ,par2 ,par3))) Regards, Neil