What impersonator contracts does Racket have in addition to `new-∀/c` and `new-∃/c`?

StackOverflow https://stackoverflow.com/questions/19850916

  •  29-07-2022
  •  | 
  •  

Question

Racket contracts are classified in three categories: Flat Contracts, Chaperone Contracts and Impersonator Contracts.

For Impersonator contracts, the only example I could find are the contracts for parametric polymorphism. Are there any other examples in addition to these?

Was it helpful?

Solution

Object and class contracts (e.g., class/c, object/c, etc.) are currently all impersonator contracts. Though chaperone versions of those may be offered eventually. In contrast, it's not possible to make parameteric contracts into chaperone contracts.

Recursive contracts constructed with recursive-contract also default to impersonator contracts, but can be configured to be any type.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top