PasteRack.org
Paste # 78624
2020-10-16 23:26:05

Fork as a new paste.

Paste viewed 381 times.


Embed:

  1. #lang racket
  2.  
  3. (require syntax/parse/define)
  4.  
  5. (define-syntax-parser mac-helper
  6.   [(mac-helper predicate:expr consequent)
  7.    #'(cond
  8.        [predicate consequent])])
  9.  
  10. (define-syntax-parser mac
  11.   [(mac p c) #'(mac-helper p c)])
  12.  
  13. (mac (positive? 5) 'hi)

=>

'hi