unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andreas Rottmann <a.rottmann@gmx.at>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-user@gnu.org
Subject: Re: Need help to understand a macro
Date: Fri, 19 Mar 2010 17:15:57 +0100	[thread overview]
Message-ID: <8739zwffsy.fsf@gmx.at> (raw)
In-Reply-To: <m3sk7wxu5k.fsf@pobox.com> (Andy Wingo's message of "Fri, 19 Mar 2010 15:28:39 +0100")

Andy Wingo <wingo@pobox.com> writes:

> Hi,
>
> On Fri 19 Mar 2010 09:57, Josef Wolf <jw@raven.inka.de> 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.
>
> 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.
>
defmacros are bound to bite you in the proverbial ass real hard when you
combine them with modules, so it's best to avoid them like the
plague. At least that's my experience, FWIW.

Regards, Rotty
-- 
Andreas Rottmann -- <http://rotty.yi.org/>




  reply	other threads:[~2010-03-19 16:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19  8:57 Need help to understand a macro Josef Wolf
2010-03-19 12:54 ` Ken Raeburn
2010-03-22 19:25   ` Josef Wolf
2010-03-22 20:16     ` Andy Wingo
2010-03-22 20:54       ` Josef Wolf
2010-03-19 14:28 ` Andy Wingo
2010-03-19 16:15   ` Andreas Rottmann [this message]
2010-03-22 19:55     ` Josef Wolf
2010-03-22 21:50       ` Andreas Rottmann
2010-03-22 19:50   ` Josef Wolf
2010-03-22 20:36     ` Andy Wingo
2010-03-22 21:01       ` Josef Wolf
2010-03-23  0:50         ` Neil Jerram
2010-03-20 14:13 ` szgyg
2010-03-22 21:06   ` Josef Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8739zwffsy.fsf@gmx.at \
    --to=a.rottmann@gmx.at \
    --cc=guile-user@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).