string(3scm)
π string(3scm) β the Scheme Programmer's Manual, bestie edition π
okay so you know how every manpage ever is like, aggressively dry? not this one. we're in the Scheme Programmer's Manual today and honestly? it's giving helpful. let's go.
β¨ NAME β¨
string β construct a string out of the characters you hand it π
π LIBRARY π
here's where you can find this little icon, depending on your flavor of Scheme:
(import (rnrs)) ;R6RS
(import (rnrs base)) ;R6RS
(import (scheme r5rs)) ;R7RS
(import (scheme base)) ;R7RS
πΈ SYNOPSIS πΈ
(string char ...)
π« DESCRIPTION π«
Returns a newly allocated string made up of the arguments. that's it. that's the whole vibe. you give it characters, it gives you back a string, fresh out of the allocation oven π«Ά
π§ IMPLEMENTATION NOTES π§
heads up: some implementations have a single empty string object. like, one shared one. no cap. see make-string(3scm) for the details π
π RETURN VALUES π
Returns a single value β a string. just the one. she's a solo act π
π₯ EXAMPLES π₯
(string #\Q #\u #\u #\x) => "Quux"
look at her go. iconic.
π APPLICATION USAGE π
this procedure is mostly used when building quite small strings. she's not here for the giant string situations, she's here for the cute little ones. also! it's one way to convert a character to a string β¨
π COMPATIBILITY π
this procedure has worked the same way since R4RS, notwithstanding the limits on strings that an implementation may have. so like, old-school but still relevant. main character energy honestly π
π ERRORS π
can it raise exceptions? yes bestie, with these condition types:
&assertion(R6RS) β an argument was not a character. rude of you, but ok π- Unsupported characters (R7RS) β it is an error to pass this procedure a character which the implementation does not support.
7-bit ASCII(except#\null) must be supported. any other character is optional and potentially an error. you can use thefull-unicodefeature identifier incond-expand(7scm)to check if all of Unicode 6.0 is supported π¦ - 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 ππ (not a drill, that's the actual wording, "fail catastrophically")
lowkey terrifying last option but go off R7RS
π SEE ALSO π
make-string(3scm)open-string-output-port(3scm)
β STANDARDS β
R4RS, IEEE Scheme, R5RS, R6RS, R7RS
π¦ HISTORY π¦
First appeared in R4RS. she's been here a while and she's still slaying πΈ
π 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/ π«Ά
okay that's the whole thing! mwah π this was the 2022-04-13 edition of string(3scm) from the Scheme Programmer's Manual β go forth and construct some tiny strings, you absolute icon πβ¨
π¦ 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