This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: guile-doc/ref/env.texi


Han-Wen Nienhuys <hanwen@cs.uu.nl> writes:

> Unfortunately my Scheme is not that good. Where can I find more about
> "writing a proper defmacro to emulate scoping". SICP doesn't deal with
> macros.

At the danger of hearing contrary opinions from some pro-Scheme
anti-Lisp people, let me suggest 'On Lisp' by Paul Graham for advanced
macrology.  The types of macros he talks about are defmacro style,
which are considered harmful(tm) by many schemers.  They are very
powerful, but tricky to use safely.

There are Scheme macro systems that give you almost (all?) of the
power of defmacro, with some protection from blowing your foot off.
I've never gotten any good at writing these types of macros, so I'm
not an expert.  There is a nice tutorial on writing syntax-case macros
in the Indiana University scheme repository (the name escapes me
now.  I'll look it up if you're interested).

The macro would turn a 'let' like form into getters and setters which
operate at the right level on the right object.  I wish I had the time
to whip up some example code, sorry for now.

-russ


--
"If you were plowing a field, which would you rather use?  Two strong
oxen or 1024 chickens?"
             -- Seymour Cray

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]