[plt-scheme] define-syntax-alias

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Oct 26 15:51:14 EDT 2009

You should instead use

 (define-syntax foo (make-rename-transformer #'bar))

which works in more cases.

At Mon, 26 Oct 2009 13:43:16 -0600, Jon Rafkind wrote:
> 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.