[racket] macro help redux

From: Todd O'Bryan (toddobryan at gmail.com)
Date: Tue Jun 8 17:43:54 EDT 2010

I feel like I'm getting there, but macros still do things that confuse me.

According to the Macro Stepper, I've written a macro that expands to:

(module fields racket
   (require "tables.rkt")
   (require "../date-utils.rkt")
     (define (create-date-field
              (contract db-date?))
       (make-date-field contract))
       (-> #:contract any/c date-field?))))))

At the next step of the expansion, I get the error:

expand: unbound identifier in module

The only problem is that "../date-utils.rkt" provides db-date? and if
I put everything inside the #%module-begin into its own DrRacket
definitions window, it runs without error. For some reason, db-date?
isn't available when it's needed, but I can't figure out how to make
it available.

What am I doing wrong?


Posted on the users mailing list.