jackfirth / rebellion

A collection of core libraries for Racket
https://pkgs.racket-lang.org/package/rebellion
Apache License 2.0
80 stars 16 forks source link

Add #:guard-maker for wrapper types #512

Closed eutro closed 2 years ago

eutro commented 2 years ago

This PR adds the #:guard-maker option to define-wrapper-type and make-wrapper-type-implementation, and adds a wrapper-guard-maker/c procedure for creating guard-makers from contracts, analogous to struct-guard/c. Note that this may not be the best for applying contracts, since the calling party is not known to the guard procedure, and thus it has to take any blame for contract violations itself.

Implements #202.