String, Character, and Bytevector Procedures

Strings and characters use Unicode scalar values with a documented ASCII-exact case approximation, and bytevectors contain bytes 0 through 255.

See it run

LISPEX
(list (string-upcase "Lispex") (char-numeric? #\7) (bytevector-u8-ref #u8(65) 0))

Observed result

OUTPUT
("LISPEX" #t 65)

How to reason about it

  • String construction, length, reference, copy, append, comparison, case conversion, mapping, and list/vector conversion are supported.
  • Character predicates and comparisons are deterministic, and char-numeric? recognizes ASCII digits only.
  • Bytevector length and bytevector-u8-ref are available with strict byte/range checks.

Text and byte signatures

SignatureResultCurrent boundary
(string-ref string k)Unicode scalar characterE312 type, E311 range
(string-append string ...)fresh immutable stringno string-set! in the current profile
(char-ci=? char char ...)boolean under ASCII-exact approximationdocumented Unicode folding edges remain
(string-map proc string)fresh string, left-to-right callbacksone string only, and the callback returns exactly one character
(bytevector-u8-ref bytes k)exact integer 0..255read-only bytevector profile

A common mistake

Exact Unicode folding, mutable strings, bytevector mutation/copy, and UTF-8 codecs are deferred.

Keep going

The manual places text and byte values among the other aggregates, and the index places these names among the other families.

Data and Aggregate Types · Procedure Index