guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please explain different macros


From: Keith Wright
Subject: Re: Please explain different macros
Date: Fri, 20 Apr 2001 15:41:45 -0400

> From: "Dale P. Smith" <address@hidden>
> 
> So: defmacro is acro, define-macro is macro,

I know nothing.

> define-syntax is mmacro ?

Not unless something is seriously wrong.

Define-syntax is the only one of these that is specified
by the Fifth Revised Report on Scheme (R5RS).  Its
meaning is described as well as anybody has yet been
able in sections 4.3 and 5.3.  The gist is

  (define-syntax <keyword> <transformer-spec>)

makes the <keyword> into a macro so that

  (<keyword> ...)

expands at _compile_ or _read_ time (i.e. before any
evaluation begins) into some expression that is
given by the <transformer-spec>.  <Transformer-
spec>s are not ordinary Scheme expressions, but are
given in a pattern language cleverly designed to
make it easy to write macro definitions that do not
produce crap due to name clashes.  The details are
too complicated to type into email right now.

I enthusiastically recommend using only
Define-syntax or the locally scoped analogs
Let-syntax or Letrec-syntax, unless they won't
work (and they work more often than most people
think at first thought).

-- 
     -- Keith Wright  <address@hidden>

Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
         ---  Food, Shelter, Source code.  ---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]