[racket] macros make my head hurt--can someone help?

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Wed Jan 26 16:48:47 EST 2011


Have you read the Macros section of the Guide yet?


The questions you're asking suggest that you want syntax-parse (or
syntax-case) instead of syntax-rules; those are all still within
define-syntax.  The guide will take you through examples of both
syntax-rules and syntax-case.

Carl Eastlund

On Wed, Jan 26, 2011 at 4:45 PM, Todd O'Bryan <toddobryan at gmail.com> wrote:
> OK, I understand that the template language in (define-syntax ...)
> doesn't give you access to the full panoply of Racket-ness. But I
> really want to manipulate the template variables before passing them
> on to the next step in the expansion. I've tried (define-for-syntax
> ..) and a couple of other things, but I keep getting errors about
> identifiers being unbound and other things which indicate in a very
> concrete way that I don't have a good grasp on how this all works.
> I've tried reading the explanation in the Reference several times, but
> I think you have to understand what it's saying before it makes sense.
> Can anyone point me to a lecture, a paper, a chapter, or a chart that
> explains exactly how Racket (and/or Scheme) gets evaluated? What's
> defined when, how the namespaces are set up, examples of clever macros
> that manipulate templates before they're output, etc?
> If such a thing doesn't exist, could someone write something up? In
> your copious free time? If I say pretty please? (This paragraph is
> much more funny if you read it with up-talk on each sentence.) :-)
> Todd

Posted on the users mailing list.