string-copy!(3scm)
π string-copy!(3scm) β straight from the Scheme Programmer's Manual π
okay bestie, gather round the group chat: this is the manual page for string-copy!, and yes the exclamation mark is part of her name. main character energy, no cap.
π·οΈ NAME
string-copy! β copy from a string into another string. It's giving "move those characters, but make it Scheme."
π LIBRARY
She lives in (scheme base) and she is R7RS, periodt:
(import (scheme base)) ;R7RS
β¨ SYNOPSIS
Three forms, all iconic:
(string-copy! to at from)
(string-copy! to at from start)
(string-copy! to at from start end)
π DESCRIPTION
okay so string-copy! copies the characters of the string from between start and end into the string to, starting at at. literally that's the whole vibe.
Now the important caveat, bestie: the order in which characters are copied is unspecified, except that if the source and destination overlap, copying takes place as if the source is first copied into a temporary string and then into the destination. This can be achieved without allocating storage by making sure to copy in the correct direction in such circumstances. π«Ά
π RETURN VALUES
Returns an unspecified value. so don't expect a little souvenir, okay? she's not giving you a return value. π
π§ͺ EXAMPLES
Here's the whole little demo, keep it exact:
(define a "12345")
(define b (string-copy "abcde"))
(string-copy! b 1 a 0 2)
b => "a12de"
and just like that, b says "a12de". slay. π
π¦ COMPATIBILITY
This procedure is unique to R7RS. no cap, she's an R7RS-only girlie.
π ERRORS
It is an error if at is less than zero or greater than the length of to.
It is also an error if (- (string-length to) at) is less than (- end start).
It is also an error if the wrong number of arguments was passed or an argument was outside its domain.
β οΈ and listen: implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically. not me saying fail catastrophically, that's just the manual. π
π SEE ALSO
string-set!(3scm) β go give her a look too, bestie.
π STANDARDS
R7RS. that's the standard, periodt.
π°οΈ HISTORY
This procedure first appeared in R7RS. In R2RS there were the procedures substring-move-right! and substring-move-left! that had the same effect. history lesson but make it cute. π
π 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/.
π
that's the whole page, bestie. this string-copy!(3scm) situation comes from the Scheme Programmer's Manual and the scheme-manpages project, and the footer date is 2022-05-14. mwah π«Ά
π¦ 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