On 06/25/2012 06:57 PM, Asumu Takikawa wrote:
On 2012-06-25 20:35:21 -0400, [email protected] wrote:
| racket/generics: add contract combinator
|
| The generics library now generates a `name/c` macro
| for a generic interface `name`. The combinator can be
| used to contract instances (or constructors) of a
| generic interface across standard contract boundaries.
To add a bit more context, the purpose of this feature is to allow
contracts to be applied to generic interfaces like how
`prop:dict/contract` does for dictionaries.
It's more flexible because it allows contracts to be added for any
interface (without any additional properties) and allows contracts
to be added at different places. e.g., you could export
`make-prime-dict` and `make-dict` constructors with different
contracts.
If nobody minds, I may go ahead and convert uses of `prop:dict/contract`
to use `dict/c` and export the latter from `racket/dict`.
IIUC from your later message, you've implemented the generics analogue
of object/c (per-instance contract), whereas prop:dict/contract is
closer to class/c (per-type contract). It's a little fuzzy because
prop:dict/contract hacks in per-instance contracts too in a kind of ad
hoc way.
Ryan
_________________________
Racket Developers list:
http://lists.racket-lang.org/dev