PasteRack.org
Paste # 34338
2017-03-15 12:33:04

Fork as a new paste.

Paste viewed 179 times.


Embed:

  1. #lang racket/base
  2.  
  3. (require
  4.   (for-syntax
  5.    racket/base))
  6.  
  7. (define-syntax (test stx)
  8.   (syntax-case stx ()
  9.     ((_ n e ...)
  10.  
  11.      #'(define-syntax (n stx)
  12.          (syntax-case stx ()
  13.            ((_ . es)
  14.             #''(n (e ...) . es)
  15.             ))))))
  16.  
  17.  
  18. (test asdf 1 2 3)
  19. (asdf 'a 'b 'c)

=>

'(asdf (1 2 3) 'a 'b 'c)