[plt-scheme] define-syntax-alias

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Oct 26 15:47:29 EDT 2009

How about using Check Syntax & rename instead? Seems like you'd end up
with clearer code afterwards.

Robby

On Mon, Oct 26, 2009 at 2:43 PM, Jon Rafkind <rafkind at cs.utah.edu> 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
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.