Fix the labels and add explicit "(untyped)" to conflicts.
This commit is contained in:
parent
81496a2ee7
commit
6102a2b8f3
1 changed files with 19 additions and 11 deletions
|
@ -217,15 +217,24 @@ same arity.
|
||||||
|
|
||||||
@section[#:tag "fuctions/untyped"]{Untyped definitions}
|
@section[#:tag "fuctions/untyped"]{Untyped definitions}
|
||||||
|
|
||||||
@defmodule[(submod dds/functions untyped)]
|
@defmodule[(submod dds/functions typed untyped)]
|
||||||
|
|
||||||
@(require (for-label (only-in racket/contract/base listof any/c)))
|
@(require (for-label (only-in racket/contract/base listof any/c)
|
||||||
|
(for-label (only-in (submod "../functions.rkt" typed untyped)
|
||||||
|
tabulate/boolean tabulate*/boolean
|
||||||
|
tabulate/01 tabulate*/01))))
|
||||||
|
|
||||||
This submodule contains some functions which cannot be typed or some functions
|
This submodule contains some functions which cannot be typed or some functions
|
||||||
for which Typed Racket cannot produce contracts, i.e. polymorphic functions of
|
for which Typed Racket cannot produce contracts, i.e. polymorphic functions of
|
||||||
variable arity. The definitions in this submodule specifically target untyped
|
variable arity. The definitions in this submodule specifically target untyped
|
||||||
user code.
|
user code.
|
||||||
|
|
||||||
|
Since the names of some of the definitions in this submodule are the same in
|
||||||
|
the main module, and since they are imported in the same namespace for
|
||||||
|
rendering this document, some references to untyped definitions may wrongfully
|
||||||
|
point to typed definitions. As a tentative fix, all such references are
|
||||||
|
accompanied by the explicit mention "untyped".
|
||||||
|
|
||||||
@(define functions-evaluator/untyped
|
@(define functions-evaluator/untyped
|
||||||
(parameterize ([sandbox-output 'string]
|
(parameterize ([sandbox-output 'string]
|
||||||
[sandbox-error-output 'string]
|
[sandbox-error-output 'string]
|
||||||
|
@ -248,8 +257,8 @@ arguments and the value of the functions for these inputs.
|
||||||
[doms (listof list?)])
|
[doms (listof list?)])
|
||||||
(listof list?)]{
|
(listof list?)]{
|
||||||
|
|
||||||
Like @racket[tabulate], but @racket[funcs] is a list of functions taking the
|
Like @racket[tabulate] (untyped), but @racket[funcs] is a list of functions
|
||||||
same arguments over the same domains.
|
taking the same arguments over the same domains.
|
||||||
|
|
||||||
@examples[#:eval functions-evaluator/untyped
|
@examples[#:eval functions-evaluator/untyped
|
||||||
(tabulate* (list (λ (x y) (and x y))
|
(tabulate* (list (λ (x y) (and x y))
|
||||||
|
@ -259,9 +268,9 @@ same arguments over the same domains.
|
||||||
|
|
||||||
@defproc[(tabulate/boolean [func procedure?]) (listof (listof boolean?))]{
|
@defproc[(tabulate/boolean [func procedure?]) (listof (listof boolean?))]{
|
||||||
|
|
||||||
Like @racket[tabulate], but assumes the domains of all variables of the
|
Like @racket[tabulate] (untyped), but assumes the domains of all variables of
|
||||||
function are Boolean. @racket[func] must have a fixed arity. It is an error
|
the function are Boolean. @racket[func] must have a fixed arity. It is an
|
||||||
to supply a function of variable arity.
|
error to supply a function of variable arity.
|
||||||
|
|
||||||
@examples[#:eval functions-evaluator/untyped
|
@examples[#:eval functions-evaluator/untyped
|
||||||
(tabulate/boolean (lambda (x y) (and x y)))
|
(tabulate/boolean (lambda (x y) (and x y)))
|
||||||
|
@ -280,8 +289,8 @@ same arity.
|
||||||
|
|
||||||
@defproc[(tabulate/01 [func procedure?]) (listof (listof (or/c 0 1)))]{
|
@defproc[(tabulate/01 [func procedure?]) (listof (listof (or/c 0 1)))]{
|
||||||
|
|
||||||
Like @racket[tabulate], but assumes the domains of all variables of the
|
Like @racket[tabulate] (untyped), but assumes the domains of all variables of
|
||||||
function are @tt{{0,1}}. @racket[func] must have a fixed arity. It is an
|
the function are @tt{{0,1}}. @racket[func] must have a fixed arity. It is an
|
||||||
error to supply a function of variable arity.
|
error to supply a function of variable arity.
|
||||||
|
|
||||||
@examples[#:eval functions-evaluator/untyped
|
@examples[#:eval functions-evaluator/untyped
|
||||||
|
@ -294,8 +303,7 @@ The same remarks apply as for @racket[tabulate/boolean] (untyped).
|
||||||
|
|
||||||
@defproc[(tabulate*/01 [funcs (listof procedure?)]) (listof (listof (or/c 0 1)))]{
|
@defproc[(tabulate*/01 [funcs (listof procedure?)]) (listof (listof (or/c 0 1)))]{
|
||||||
|
|
||||||
Like @racket[tabulate/01] (untyped), but takes a list of functions of the
|
Like @racket[tabulate/01], but takes a list of functions of the same arity.
|
||||||
same arity.
|
|
||||||
|
|
||||||
@examples[#:eval functions-evaluator/untyped
|
@examples[#:eval functions-evaluator/untyped
|
||||||
(tabulate*/01 `(,(λ (x y) (min x y)) ,(λ (x y) (max x y))))
|
(tabulate*/01 `(,(λ (x y) (min x y)) ,(λ (x y) (max x y))))
|
||||||
|
|
Loading…
Reference in a new issue