[plt-scheme] define-syntax-alias

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Mon Oct 26 15:43:16 EDT 2009

Would anyone else appreciate this function `define-syntax-alias' in the 
core? Maybe in syntax/stx or something.

(require (for-syntax syntax/stx))
(define-syntax (define-syntax-alias stx)
 (syntax-case stx ()
   [(_ a b)
     #'(define-syntax (a stx)
           #`(b #,@(stx-cdr stx)))]))

(define-syntax (bar stx)
  (syntax-case stx ()
    [(_ a b ...) #'a]))
(define-syntax-alias foo bar)
(foo 1 2 3 4)

==> 1


Posted on the users mailing list.