6.2
5 Contracts for Macro Subexpressions
This library provides a procedure wrap-expr/c for applying
contracts to macro subexpressions.
Returns a syntax object representing an expression that applies the
contract represented by contract-expr to the value produced
by expr.
The other arguments have the same meaning as for expr/c.
Examples: |
| | | '(1 2 3) | > (myparameterize1 (['whoops 'something]) | 'whatever) |
| the parameter argument of myparameterize1: broke its | contract | promised: parameter? | produced: 'whoops | in: parameter? | contract from: top-level | blaming: top-level | (assuming the contract is correct) | at: eval:4.0 | | | > (require 'mod) | | > (app add1 5) | 6 | > (app add1 'apple) | the function argument of app: contract violation | expected: number? | given: 'apple | in: the 1st argument of | (-> number? number?) | contract from: top-level | blaming: (quote mod) | (assuming the contract is correct) | at: eval:8.0 | > (app (lambda (x) 'pear) 5) | the function argument of app: broke its contract | promised: number? | produced: 'pear | in: the range of | (-> number? number?) | contract from: top-level | blaming: top-level | (assuming the contract is correct) | at: eval:9.0 |
|