[plt-scheme] Macro-expansion-time structs

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Oct 11 21:14:50 EDT 2008

On Oct 11, Henk Boom wrote:
> I want to define a struct to use in a macro at expansion time, but
> since define-struct defines the construction/utility functions
> itself, I cannot use define-for-syntax. As a workaround I have put
> the structure definition in a separate module and require it with
> for-syntax, but is there a better way to do this?

On Oct 11, Henk Boom wrote:
> [...]
> However, if I switch the above to use #lang scheme/base, I get the
> following:
> [...]

The answer to both of these questions is that you should use

  (require (for-syntax scheme/base))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.