[racket] Compile-time vs. Runtime Calls to the Same Macro

From: Sina K. Heshmati (sina at khakbaz.com)
Date: Sat Feb 26 09:58:41 EST 2011


#lang racket
 (for-syntax "check.rkt")

(define-for-syntax a
  (qualify-member #'(public static a 0)))  ;; Phase 1 call FAILS

(define b
  (qualify-member #'(public static b 10))) ;; Phase 2 call does NOT FAIL

Any idea how I can make phase 1 calls to qualify-member not fail?

The file check.rkt that contains the qualify-member macro is pasted below. 
For other source files, please refer to:

Thank you in advance,

------------------------------------------- check.rkt
#lang racket

 (for-syntax "members.rkt")
 (for-syntax "utils.rkt")

(provide qualify-member)

(define-syntax (qualify-member stx)
  (syntax-case stx ()
    ((qualify-member member)
             (λ (exn)
                "Invalid class member \n ~a" exn))))
         (show member)
         (syntax-case member #,*member-keywords*
               (λ (qualifier matcher)
                 #`((#, at matcher)
                    (#,qualifier member)))

Posted on the users mailing list.