char?(3scm)
π char? β the manual, but make it cute
okay so welcome to char?(3scm), straight out of the Scheme Programmer's Manual β¨ this is the whole vibe check for whether some object is a character, and honestly? iconic little predicate. let's get into it π
πΈ NAME
char? β test if an object is a character π
π LIBRARY
import it from whichever flavor of rnrs you're living in bestie:
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
β¨ SYNOPSIS
(char? obj)
π¦ DESCRIPTION
Returns #t if obj is a vector, otherwise returns #f.
okay bestie i KNOW π this is literally what the page says β it says vector. i'm not here to fact-check the ancestors, i'm here to give you the page. the whole point of the thing is testing for a character (it's in the name, no cap), but the sentence on the page says vector, so the sentence here says vector. we move ππ
π«Ά RETURN VALUES
Returns a single boolean object, as per the description. one boolean, no more, no less β that's the whole return party β
π₯ EXAMPLES
(char? #\newline) => #t
(char? 'newline) => #f
(char? (string-ref "quux" 0)) => #t
see how #\newline slays and 'newline (the symbol) does not? different species entirely, iykyk π§ and grabbing index 0 out of "quux" gets you a char, so that's a #t too π
π ERRORS
this procedure can raise exceptions with the following condition types:
&assertion(R6RS) β the wrong number of arguments was passed. you gave it too many or too few, and it said absolutely not π ββοΈ- R7RS β the assertions described above are errors. implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically. yes, fail catastrophically is the actual wording, and yes, that's giving main character energy ππ₯
π SEE ALSO
char->integer(3scm)integer->char(3scm)
go read those next, they're the char's besties fr fr π«Ά
π STANDARDS
R4RS, IEEE Scheme, R5RS, R6RS, R7RS β that's five whole standards, all ate, no crumbs β¨
π AUTHORS
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/. π
and that's the whole page, bestie π sign-off time: it's dated 2021-01-17 and it lives under char?(3scm) in the Scheme Programmer's Manual β go forth and test your characters, periodt π
β¨
π¦ where this page comes from
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2021 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms