[plt-scheme] Macros in Macros

From: Henk Boom (lunarc.lists at gmail.com)
Date: Sun Oct 12 19:47:41 EDT 2008

The following works:

---
#lang scheme/base

(require (for-syntax scheme/base
                     (for-syntax scheme/base)))
(provide test)

(define-syntax (test stx)
  (define-syntax (foo stx)
    #`#,2)
  #`#,(foo stx))
---

I have two questions. First, is nesting for-syntax clauses the right
way to be able to write these sorts of macros? Secondly, is there a
way to define the 'foo' macro globally for the module? I'm prohibited
from including it in a begin-for-syntax clause.

    Henk


Posted on the users mailing list.