string-ci=?(3scm)
hey bestie!! welcome to the string-ci=?(3scm) page β it's from the Scheme Programmer's Manual, and it's serving case-insensitive string comparison realness. no cap, these are the little comparison besties you call when you want string=? vibes but with case folded away π
π NAME π
string-ci=?, string-ci<?, string-ci>?, string-ci<=?, string-ci>=? β case-insensitive string comparison. that's the whole squad, periodt.
π LIBRARY π
import these bad boys depending on your flavor:
(import (rnrs)) ;R6RS
(import (rnrs unicode)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme char)) ;R7RS
β¨ SYNOPSIS β¨
the call shapes are literally:
(string-ci=? string1 string2 string3 ...)
(string-ci<? string1 string2 string3 ...)
(string-ci>? string1 string2 string3 ...)
(string-ci<=? string1 string2 string3 ...)
(string-ci>=? string1 string2 string3 ...)
πΈ DESCRIPTION πΈ
okay so these procedures are similar to string=?, string<?, etc., but they operate on the case-folded versions of the strings. case-folding is done as if by applying string-foldcase(3scm) to the strings. that's the whole magic trick β¨
π RETURN VALUES π
every call returns a single value, a boolean. yes bestie, just #t or #f β no extra luggage π
π¦ EXAMPLES π¦
here's the example energy, copied exactly:
(string-ci=? "z" "Z") => #t
;; May return #t in R7RS.
(string-ci<? "z" "Z") => #f
;; Can return #f in R7RS, and the characters may not be supported.
(string-ci=? "StraΓe" "Strasse") => #t
(string-ci=? "StraΓe" "STRASSE") => #t
(string-ci=? "XAOΞ£" "ΟΞ±oΟ") => #t
π COMPATIBILITY π
the basic idea of these procedures is the same in all RnRS revisions. however, there are some differences, and they're kinda important:
R5RSand earlier reports only provided two-argument variants.R6RSimplementations are mainly the same, except that they may behave differently depending on which version of the Unicode standard they support.R7RSimplementations may lack support for some characters. The order is also implementation-defined, with lexicographical ordering only being one option.
π ERRORS π
this procedure can raise exceptions with the following condition types:
&assertion(R6RS) β The wrong number of arguments was passed or an argument was outside its domain.- 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.
π SEE ALSO π
string=?(3scm), string-foldcase(3scm) β go give 'em a look too, bestie π
β STANDARDS β
R4RS, IEEE Scheme, R5RS, R6RS, R7RS β the whole standards family reunion β
π°οΈ HISTORY π°οΈ
these procedures first appeared in R2RS. a true icon from way back π°οΈ
π 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/. shoutout to the project, fr fr π
bye bestie!! this string-ci=?(3scm) page is dated 2022-04-08 β that's the cute sign-off from the scheme-manpages manual page, and you're all set to compare strings case-insensitively πβ¨
π¦ where this page comes from
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2022 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms