On this page:
regexp-match/  c
id/  c
define/  contract?
5.1 Untyped versions of contract

5 contract

Georges Dupéron <[email protected]>


(regexp-match/c rx)  contract?

  rx : (or/c string? regexp?)
(and/c (or/c string? bytes? path? input-port?)
       (curry regexp-match? rx))
Returns a contract which accepts only values matching the given regular expression.


(id/c id)  contract?

  id : identifier?
 = (and/c identifier? (curry free-identifier=? id))
Returns a contract which accepts only identifiers which are free-identifier=? to id.

Like define/contract, but later versions of this library may allow disabling the contracts via a parameter or syntax parameter. This form will be useful for internal functions, to ease debugging during development, but with the (future) possibility of disabling the contracts in the final version, to avoid the performance cost of checking many contracts between internal functions.

5.1 Untyped versions of contract

 (require phc-toolkit/untyped/contract)
  package: phc-toolkit