Hi,

On Fri 19 Mar 2010 09:57, Josef Wolf <j...@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.

http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=doc/ref/api-macros.texi;h=51f54ed070af453a138282f61e7cd8dbbddc53a3;hb=HEAD

Happy hacking,

Andy
-- 
http://wingolog.org/


Reply via email to