I have a pending pull request (https://github.com/plt/racket/pull/1004)
that improves unit contracts in the following ways:
1. allowing contracts to protect the result of invoking a unit and
2. checking of initialization dependencies (init-depend clauses)
These changes are in preparation for supporting units in Typed Racket to
ensure safe interactions between typed and untyped units.
Unfortunately, these changes introduce a minor backwards incompatibility.
For example, the following program will now trigger a contract violation
while it previously did not.
(define-signature a^ ())
(define/contract u
(unit/c (import a^) (export))
(unit (import a^) (export) (init-depend a^)))
Because the contract does not list the initialization dependency on a^
whereas the unit value does, it does not satisfy the contract.
No known Racket code (either on pkgs.racket-lang.org or PLaneT) is broken
by these changes, but in the unlikely event that your code is affected, the
solution is to add the initialization dependencies of the unit to its
contract.
If you have any questions or if some of your code is affected by these
changes please let me know.
Thanks
Dan Feltey
--
You received this message because you are subscribed to the Google Groups
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-dev/CA%2BnS5Kbp2W-34bmLwmWBKTT1BJVT79vgBy0i%2BR5pj5d%3DDmCQAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.