string-ci=?(3scm)

πŸ“¦ version 0-unstable-2024-02, in nixpkgs unstable

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:

  • R5RS and earlier reports only provided two-argument variants.
  • R6RS implementations are mainly the same, except that they may behave differently depending on which version of the Unicode standard they support.
  • R7RS implementations 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