From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josef Wolf Newsgroups: gmane.lisp.guile.user Subject: Re: Need help to understand a macro Date: Mon, 22 Mar 2010 20:50:25 +0100 Message-ID: <20100322195025.GC31143@raven.wolf.lan> References: <20100319085701.GA31143@raven.wolf.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269288050 9701 80.91.229.12 (22 Mar 2010 20:00:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 22 Mar 2010 20:00:50 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Mar 22 21:00: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 1Ntnnp-0004hz-Qe for guile-user@m.gmane.org; Mon, 22 Mar 2010 21:00:46 +0100 Original-Received: from localhost ([127.0.0.1]:58688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ntnnp-0002Bx-AC for guile-user@m.gmane.org; Mon, 22 Mar 2010 16:00:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NtnnO-0001xy-Ai for guile-user@gnu.org; Mon, 22 Mar 2010 16:00:18 -0400 Original-Received: from [140.186.70.92] (port=35436 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NtnnM-0001xT-1p for guile-user@gnu.org; Mon, 22 Mar 2010 16:00:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NtnnJ-0001yc-8c for guile-user@gnu.org; Mon, 22 Mar 2010 16:00:15 -0400 Original-Received: from quechua.inka.de ([193.197.184.2]:36147 helo=mail.inka.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NtnnI-0001yE-Vg for guile-user@gnu.org; Mon, 22 Mar 2010 16:00:13 -0400 Original-Received: from raven.inka.de (uucp@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1NtnnH-0001gc-DU; Mon, 22 Mar 2010 21:00:11 +0100 Original-Received: by raven.inka.de (Postfix, from userid 1000) id 63A38760B0; Mon, 22 Mar 2010 20:50:25 +0100 (CET) Mail-Followup-To: Josef Wolf , guile-user@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:7703 Archived-At: On Fri, Mar 19, 2010 at 03:28:39PM +0100, Andy Wingo wrote: > Hi, > > On Fri 19 Mar 2010 09:57, Josef Wolf writes: > > > (show-expansion (defstruct tree height girth age leaf-shape leaf-color)) > > (macroexpand '(defstruct ...)) > > You might want to surround that with (pretty-print ...) from (ice-9 > pretty-print). > > > Of course this is possible. After all, code is data and data is code. > > Sorta. Syntax-rules/syntax-case macros operate on syntax objects, not on > raw s-expressions. This allows them to preserve referential > transparency. So the result of expansion might not look like what you > would expect. Ummm, I just started to hammer this macro thing into my head, so I don't understand (yet) what you are talking about. I thought the power of lisp macros comes from the fact that they operate on s-expressions? What are syntax objects? What is referential transparency? > Read up on syntax-rules and syntax-case macros, when you get some time. > I used to love defmacros but I don't use them any more. > > http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=doc/ref/api-macros.texi;h=51f54ed070af453a138282f61e7cd8dbbddc53a3;hb=HEAD Where can I find a version translated in pdf or html or something? Thanks Andy!