[racket] getting the term in syntax-id-rules

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Mon Sep 5 13:50:38 EDT 2011

> Is there a reason not to just use `syntax-case' (or even better,
> `syntax-parse')?

Sheer ignorance, my dear chap.  I didn't realize that that worked!
(A docs hint may be in order....)

For those reading this later, here's an example:

(define-syntax (String$ stx)
  (syntax-case stx (String$)
    [String$
     (with-syntax ([term stx])
       #'(first-order-sig string? #'term))]))

but also note the discussion on the thread "syntax-parse and literals"
on why syntax-parse is better than syntax-case (and it's not just
because of the parsing).

Shriram


Posted on the users mailing list.