[racket] syntax-local-value of define-syntax-class

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Mon Feb 27 15:21:17 EST 2012

I thought syntax-local-value would produce the syntax-class object that a given identifier is bound to but it errors out with 'x is not defined as syntax'. Any ideas why? There is one part of my original code base where this works and another where it doesn't. I cannot seem to replicate the part that works in a small test case.

#lang racket

(require (for-syntax syntax/parse))

(begin-for-syntax
  (define-syntax-class x))

(define-syntax (bar stx)
  (syntax-case stx ()
    [(_ name) (syntax-local-value #'name)]))

(bar x)


Posted on the users mailing list.