Rackety
This commit is contained in:
parent
5b879d0680
commit
6461b1feae
|
@ -4,7 +4,7 @@
|
||||||
(for-label mzlib/contract))
|
(for-label mzlib/contract))
|
||||||
|
|
||||||
@(define-syntax-rule (twocolumns id ...)
|
@(define-syntax-rule (twocolumns id ...)
|
||||||
(*twocolumns (list (scheme id) ...)))
|
(*twocolumns (list (racket id) ...)))
|
||||||
@(define (*twocolumns uneven-l)
|
@(define (*twocolumns uneven-l)
|
||||||
(let* ([l (if (zero? (modulo (length uneven-l) 2)) uneven-l (append uneven-l (list #f)))]
|
(let* ([l (if (zero? (modulo (length uneven-l) 2)) uneven-l (append uneven-l (list #f)))]
|
||||||
[len (length l)]
|
[len (length l)]
|
||||||
|
@ -27,14 +27,14 @@
|
||||||
|
|
||||||
This library is designed as a backwards compatible library
|
This library is designed as a backwards compatible library
|
||||||
for old uses of contracts. It should not be used for new
|
for old uses of contracts. It should not be used for new
|
||||||
libraries; use @schememodname[scheme/contract] instead.
|
libraries; use @racketmodname[racket/contract] instead.
|
||||||
|
|
||||||
The main differences: the function contract syntax is more
|
The main differences: the function contract syntax is more
|
||||||
regular and function contracts now support keywords, and
|
regular and function contracts now support keywords, and
|
||||||
@tt{union} is now @scheme[or/c].
|
@tt{union} is now @racket[or/c].
|
||||||
|
|
||||||
The @schememodname[mzlib/contract] library re-exports many bindings
|
The @racketmodname[mzlib/contract] library re-exports many bindings
|
||||||
from @schememodname[scheme/contract]:
|
from @racketmodname[racket/contract]:
|
||||||
|
|
||||||
@twocolumns[
|
@twocolumns[
|
||||||
</c
|
</c
|
||||||
|
@ -90,18 +90,18 @@ It also provides the old version of the following forms:
|
||||||
|
|
||||||
@defform[(define/contract id contract-expr init-value-expr)]{
|
@defform[(define/contract id contract-expr init-value-expr)]{
|
||||||
|
|
||||||
Attaches the contract @scheme[contract-expr] to
|
Attaches the contract @racket[contract-expr] to
|
||||||
@scheme[init-value-expr] and binds that to @scheme[id].
|
@racket[init-value-expr] and binds that to @racket[id].
|
||||||
|
|
||||||
The @scheme[define/contract] form treats individual definitions as
|
The @racket[define/contract] form treats individual definitions as
|
||||||
units of blame. The definition itself is responsible for positive
|
units of blame. The definition itself is responsible for positive
|
||||||
(co-variant) positions of the contract and each reference to
|
(co-variant) positions of the contract and each reference to
|
||||||
@scheme[id] (including those in the initial value expression) must
|
@racket[id] (including those in the initial value expression) must
|
||||||
meet the negative positions of the contract.
|
meet the negative positions of the contract.
|
||||||
|
|
||||||
Error messages with @scheme[define/contract] are not as clear as those
|
Error messages with @racket[define/contract] are not as clear as those
|
||||||
provided by @scheme[provide/contract], because
|
provided by @racket[provide/contract], because
|
||||||
@scheme[define/contract] cannot detect the name of the definition
|
@racket[define/contract] cannot detect the name of the definition
|
||||||
where the reference to the defined variable occurs. Instead, it uses
|
where the reference to the defined variable occurs. Instead, it uses
|
||||||
the source location of the reference to the variable as the name of
|
the source location of the reference to the variable as the name of
|
||||||
that definition.}
|
that definition.}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user