string->vector(3scm)
β¨ string->vector β it's giving string-to-vector energy β¨
okay so real talk, this page lives in the Scheme Programmer's Manual (that's the 3scm bit, iykyk) and it's about one iconic little procedure. let's get into it π
π NAME
string->vector β convert a string to a vector. that's it. that's the whole gig. slay.
π LIBRARY
(import (scheme base)) ;R7RS
yes bestie you gotta import it, it's not just gonna show up on its own π«Ά
πΈ SYNOPSIS
(string->vector string)
(string->vector string start)
(string->vector string start end)
three whole forms, pick your fighter β¨
π¦ DESCRIPTION
Returns a newly created vector initialized to the elements of string between start (inclusive) and end (exclusive). the order of the characters is preserved β no shuffling, no chaos, everything stays in its lane π
if you omit them, start defaults to 0 and end defaults to the length of string. so like, the lazy version totally works, no cap.
π RETURN VALUES
Returns a single value β a vector object. one value, one vibe, one icon π
β EXAMPLES
(string->vector "ABC") => #(#\A #\B #\C)
literally the whole thing. ate and left no crumbs π
π ERRORS
It is an error to pass the wrong number of arguments, and to pass an argument that's outside its domain. and because Scheme loves to keep you on your toes, implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically π so yeah, maybe don't. not me warning you dramatically but also genuinely, that last one is real π₯
π SEE ALSO
string->list(3scm)β the cousin, the sibling, the other one
π STANDARDS
R7RS, SRFI-133, SRFI-140, SRFI-152 β certified, validated, multiple-standards-approved π
π§ HISTORY
This procedure first appeared in R7RS. a legend from day one, no notes.
π AUTHORS
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. more info (and the whole treasure trove) lives at https://github.com/schemedoc/manpages/ π«Ά
bestie reminder:startis inclusive,endis exclusive, and yes everybody gets that backwards the first time π
okay that's the whole page!! sourced from the scheme-manpages project, dated 2022-05-14 β mwah, go convert some strings πβ¨
π¦ 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