diff --git a/pkgs/racket-doc/scribblings/reference/bytes.scrbl b/pkgs/racket-doc/scribblings/reference/bytes.scrbl index 339e43e5a1..ec11ffa762 100644 --- a/pkgs/racket-doc/scribblings/reference/bytes.scrbl +++ b/pkgs/racket-doc/scribblings/reference/bytes.scrbl @@ -15,6 +15,8 @@ string is provided to a procedure like @racket[bytes-set!], the @exnraise[exn:fail:contract]. Byte-string constants generated by the default reader (see @secref["parse-string"]) are immutable, and they are @tech{interned} in @racket[read-syntax] mode. +Use @racket[immutable?] to check whether a byte string is +immutable. Two byte strings are @racket[equal?] when they have the same length and contain the same sequence of bytes. diff --git a/pkgs/racket-doc/scribblings/reference/data.scrbl b/pkgs/racket-doc/scribblings/reference/data.scrbl index a9336e1660..059011edfc 100644 --- a/pkgs/racket-doc/scribblings/reference/data.scrbl +++ b/pkgs/racket-doc/scribblings/reference/data.scrbl @@ -90,6 +90,14 @@ for each pair of keywords is the same as using A @deftech{box} is like a single-element vector, normally used as minimal mutable storage. +A box can be @defterm{mutable} or +@defterm{immutable}. When an immutable box is provided to a +procedure like @racket[set-box!], the +@exnraise[exn:fail:contract]. Box constants generated by the +default reader (see @secref["parse-string"]) are +immutable. Use @racket[immutable?] to check whether a box is +immutable. + A literal or printed box starts with @litchar{#&}. @see-read-print["box"]{boxes} @defproc[(box? [v any/c]) boolean?]{ diff --git a/pkgs/racket-doc/scribblings/reference/hashes.scrbl b/pkgs/racket-doc/scribblings/reference/hashes.scrbl index 044153aca5..6472a2b9ec 100644 --- a/pkgs/racket-doc/scribblings/reference/hashes.scrbl +++ b/pkgs/racket-doc/scribblings/reference/hashes.scrbl @@ -25,7 +25,8 @@ table is also either mutable or immutable. Immutable hash tables support effectively constant-time access and update, just like mutable hash tables; the constant on immutable operations is usually larger, but the functional nature of immutable hash tables can pay off in -certain algorithms. +certain algorithms. Use @racket[immutable?] to check whether a hash +table is immutable. @margin-note{Immutable hash tables actually provide @math{O(log N)} access and update. Since @math{N} is limited by the address space so diff --git a/pkgs/racket-doc/scribblings/reference/strings.scrbl b/pkgs/racket-doc/scribblings/reference/strings.scrbl index 65e44e7b0a..1b8db1cd8c 100644 --- a/pkgs/racket-doc/scribblings/reference/strings.scrbl +++ b/pkgs/racket-doc/scribblings/reference/strings.scrbl @@ -14,6 +14,7 @@ procedure like @racket[string-set!], the @exnraise[exn:fail:contract]. String constants generated by the default reader (see @secref["parse-string"]) are immutable, and they are @tech{interned} in @racket[read-syntax] mode. +Use @racket[immutable?] to check whether a string is immutable. Two strings are @racket[equal?] when they have the same length and contain the same sequence of characters. diff --git a/pkgs/racket-doc/scribblings/reference/vectors.scrbl b/pkgs/racket-doc/scribblings/reference/vectors.scrbl index 2cf868288d..d43fd0091d 100644 --- a/pkgs/racket-doc/scribblings/reference/vectors.scrbl +++ b/pkgs/racket-doc/scribblings/reference/vectors.scrbl @@ -16,7 +16,8 @@ the values in corresponding slots of the vectors are A vector can be @defterm{mutable} or @defterm{immutable}. When an immutable vector is provided to a procedure like @racket[vector-set!], the @exnraise[exn:fail:contract]. Vectors generated by the default -reader (see @secref["parse-string"]) are immutable. +reader (see @secref["parse-string"]) are immutable. Use +@racket[immutable?] to check whether a vector is immutable. A vector can be used as a single-valued sequence (see @secref["sequences"]). The elements of the vector serve as elements