www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

optcontract.rkt (676B)


      1 #lang racket
      2 
      3 (provide (except-out (all-from-out racket/contract)
      4                      define-struct/contract
      5                      ;define/contract
      6                      provide/contract
      7                      invariant-assertion)
      8          define/contract
      9          define/contract/always
     10          define/contract/alt)
     11 
     12 (require (rename-in racket/contract
     13                     [define/contract define/contract/always]))
     14 
     15 (define-syntax-rule (define/contract sig c . rest)
     16   (define sig . rest))
     17 
     18 ;; The alt-code is executed in the body of the function when the contract is
     19 ;; disabled:
     20 (define-syntax-rule (define/contract/alt sig c alt-code . rest)
     21   (define sig alt-code . rest))