added docs for set/c
moved docs for predicates down near the end of the file; currently it goes: constructors, operations, predicates & contract, iterator stuff added docs for set-equal?
This commit is contained in:
parent
0411cddba5
commit
cdd099f024
|
@ -22,21 +22,6 @@ unpredictable when keys are mutated.
|
||||||
|
|
||||||
@note-lib[racket/set]
|
@note-lib[racket/set]
|
||||||
|
|
||||||
@defproc[(set? [v any/c]) boolean?]{
|
|
||||||
|
|
||||||
Returns @racket[#t] if @racket[v] is a @tech{set}, @racket[#f]
|
|
||||||
otherwise.}
|
|
||||||
|
|
||||||
@defproc[(set-eqv? [st set?]) boolean?]{
|
|
||||||
|
|
||||||
Returns @racket[#t] if @racket[st] compares elements with @racket[eqv?],
|
|
||||||
@racket[#f] if it compares with @racket[equal?] or @racket[eq?].}
|
|
||||||
|
|
||||||
@defproc[(set-eq? [st set?]) boolean?]{
|
|
||||||
|
|
||||||
Returns @racket[#t] if @racket[st] compares elements with @racket[eq?],
|
|
||||||
@racket[#f] if it compares with @racket[equal?] or @racket[eqv?].}
|
|
||||||
|
|
||||||
@deftogether[(
|
@deftogether[(
|
||||||
@defproc[(set [v any/c] ...) set?]
|
@defproc[(set [v any/c] ...) set?]
|
||||||
@defproc[(seteqv [v any/c] ...) set?]
|
@defproc[(seteqv [v any/c] ...) set?]
|
||||||
|
@ -151,6 +136,35 @@ Applies @racket[proc] to each element in @racket[st] (for the
|
||||||
side-effects of @racket[proc]) in an unspecified order.}
|
side-effects of @racket[proc]) in an unspecified order.}
|
||||||
|
|
||||||
|
|
||||||
|
@defproc[(set? [v any/c]) boolean?]{
|
||||||
|
|
||||||
|
Returns @racket[#t] if @racket[v] is a @tech{set}, @racket[#f]
|
||||||
|
otherwise.}
|
||||||
|
|
||||||
|
@defproc[(set-equal? [st set?]) boolean?]{
|
||||||
|
|
||||||
|
Returns @racket[#t] if @racket[st] compares elements with @racket[equal?],
|
||||||
|
@racket[#f] if it compares with @racket[eqv?] or @racket[eq?].}
|
||||||
|
|
||||||
|
|
||||||
|
@defproc[(set-eqv? [st set?]) boolean?]{
|
||||||
|
|
||||||
|
Returns @racket[#t] if @racket[st] compares elements with @racket[eqv?],
|
||||||
|
@racket[#f] if it compares with @racket[equal?] or @racket[eq?].}
|
||||||
|
|
||||||
|
@defproc[(set-eq? [st set?]) boolean?]{
|
||||||
|
|
||||||
|
Returns @racket[#t] if @racket[st] compares elements with @racket[eq?],
|
||||||
|
@racket[#f] if it compares with @racket[equal?] or @racket[eqv?].}
|
||||||
|
|
||||||
|
@defproc[(set/c [contract contract?] [#:cmp cmp (or/c 'dont-care 'equal 'eqv 'eq) 'dont-care]) contract?]{
|
||||||
|
Constructs a contract that recognizes sets whose elements match @racket[contract].
|
||||||
|
|
||||||
|
If @racket[cmp] is @racket['dont-care], then the equality notion of the set is not considered
|
||||||
|
when checking the contract. Otherwise, the contract accepts only sets with the corresponding
|
||||||
|
notion of equality.
|
||||||
|
}
|
||||||
|
|
||||||
@defproc[(in-set [st set?]) sequence?]{
|
@defproc[(in-set [st set?]) sequence?]{
|
||||||
|
|
||||||
Explicitly converts a set to a sequence for use with @racket[for] and
|
Explicitly converts a set to a sequence for use with @racket[for] and
|
||||||
|
|
Loading…
Reference in New Issue
Block a user