PasteRack.org
Paste # 99169
2018-02-12 12:05:24

Fork as a new paste.

Paste viewed 28 times.


Embed:

  1. #lang racket
  2.  
  3. (require (for-syntax racket/string)
  4.          syntax/parse/define)
  5.  
  6. (define-simple-macro (hyphen-define/many/ok1 (component:id ...+) (arg ...) body ...+)
  7.   #:with name (datum->syntax
  8.                this-syntax
  9.                (string->symbol
  10.                 (string-join
  11.                  (for/list ([component-stx (in-list (attribute component))])
  12.                    (symbol->string (syntax->datum component-stx)))
  13.                  "-")))
  14.   (define (name arg ...)
  15.     body ...))

=>