clarify effective-constant nature of `list?'
Closes PR 11525
This commit is contained in:
parent
335e679ec7
commit
f6f6facd9e
|
@ -153,7 +153,10 @@ null
|
||||||
|
|
||||||
@defproc[(list? [v any/c]) boolean?]{Returns @scheme[#t] if @scheme[v]
|
@defproc[(list? [v any/c]) boolean?]{Returns @scheme[#t] if @scheme[v]
|
||||||
is a list: either the empty list, or a pair whose second element is a
|
is a list: either the empty list, or a pair whose second element is a
|
||||||
list. This procedure takes amortized constant time.
|
list. This procedure effectively takes constant time due to internal caching
|
||||||
|
(so that any necessary traversals of pairs can in principle count as an
|
||||||
|
extra cost of allocating the pairs).
|
||||||
|
|
||||||
@mz-examples[
|
@mz-examples[
|
||||||
(list? '(1 2))
|
(list? '(1 2))
|
||||||
(list? (cons 1 (cons 2 '())))
|
(list? (cons 1 (cons 2 '())))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user