Add documentation for #:opaque keyword.
This commit is contained in:
parent
db3c96a2a0
commit
5a27a8538c
|
@ -1494,9 +1494,13 @@ resulting trait are the same as for @racket[trait-sum], otherwise the
|
||||||
@defform/subs[
|
@defform/subs[
|
||||||
#:literals (field init init-field inherit inherit-field super inner override augment augride absent)
|
#:literals (field init init-field inherit inherit-field super inner override augment augride absent)
|
||||||
|
|
||||||
(class/c member-spec ...)
|
(class/c maybe-opaque member-spec ...)
|
||||||
|
|
||||||
([member-spec
|
([maybe-opaque
|
||||||
|
(code:line)
|
||||||
|
(code:line #:opaque)]
|
||||||
|
|
||||||
|
[member-spec
|
||||||
method-spec
|
method-spec
|
||||||
(field field-spec ...)
|
(field field-spec ...)
|
||||||
(init field-spec ...)
|
(init field-spec ...)
|
||||||
|
@ -1538,6 +1542,12 @@ for writing method contracts.
|
||||||
|
|
||||||
Methods and fields listed in an @racket[absent] clause must @emph{not} be present in the class.
|
Methods and fields listed in an @racket[absent] clause must @emph{not} be present in the class.
|
||||||
|
|
||||||
|
A class contract can be specified to be @emph{opaque} with the @racket[#:opaque]
|
||||||
|
keyword. An opaque class contract will only accept a class that defines
|
||||||
|
exactly the methods and fields specified by the contract. A contract error
|
||||||
|
is raised if the contracted class contains any methods or fields that are
|
||||||
|
not specified.
|
||||||
|
|
||||||
The external contracts are as follows:
|
The external contracts are as follows:
|
||||||
|
|
||||||
@itemize[
|
@itemize[
|
||||||
|
|
Loading…
Reference in New Issue
Block a user