PasteRack.org
Paste # 4224
2019-07-22 18:47:00

Fork as a new paste.

Paste viewed 496 times.


Embed:

  1. #lang racket
  2.  
  3. (define-syntax-rule (def/c head contract body ...)
  4.   ;(define/contract head contract body ...)
  5.   (define head body ...))
  6.  
  7. (def/c (foo a b)
  8.   (-> integer? symbol? string?)
  9.   (format "~a ~a" a b))
  10.  
  11. (foo 9 'bar)

=>

"9 bar"