(module alias mzscheme ;; Practice writing macros that themselves generate macros. (provide alias) ;; (alias old-keyword new-keyword) SYNTAX ;; Creates a new syntax for new-keyword; any occurrence of new-keyword ;; is replaced with the old-keyword. (define-syntax (alias stx-1) (syntax-case stx-1 () [(_1 orig new) (syntax/loc stx-1 (define-syntax (new stx-2) (syntax-case stx-2 () [_2 (identifier? stx-2) (syntax/loc stx-2 orig)] [(_2 e (... ...)) (syntax/loc stx-2 (orig e (... ...)))])))])))