bytevector?(3scm)
β¨ NAME β¨
okay so this is bytevector? β it's a Scheme thing from the Scheme Programmer's Manual, and what it does is test if an object is a bytevector π
π LIBRARY π
here's where you import it from, depending on your vibe:
(import (rnrs)) ;R6RS
(import (rnrs bytevectors)) ;R6RS
(import (scheme base)) ;R7RS
π SYNOPSIS π
(bytevector? obj)
π DESCRIPTION π
So you hand it obj and it's like: is this a bytevector bestie or not π
- if
objis a bytevector β it gives you back#t(slay) - if
objis not a bytevector β it gives you back#f(not slay, but valid)
that's literally the whole thing. no cap.
π«Ά RETURN VALUES π«Ά
Returns a single boolean object, exactly as the description says. one boolean, that's it, that's the whole return π«
π₯ EXAMPLES π₯
look at these, they eat:
(bytevector? #vu8(1 2 3)) => #t ; R6RS
(bytevector? #u8(1 2 3)) => #t ; R7RS
(bytevector? "123") => #f
(bytevector? '#(1 2 3)) => #f
see how "123" is a string and not a bytevector? and '#(1 2 3) is a regular vector, also not a bytevector? yeah. don't get it twisted π§
π COMPATIBILITY π
Bytevectors are a disjoint type in both R6RS and R7RS β meaning they're their own separate little category, they don't overlap with other types. this is specified in R6RS standard libraries Β§ 2 and in R7RS Β§ 3.2. iconic of the standards committee tbh π
π ERRORS π
bestie, this procedure can raise exceptions with the following condition types:
&assertion(R6RS) β the wrong number of arguments was passed. like, you gave it too many or too few args and it's Not Happy.- 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. yes, catastrophically, they really said that π
fr fr read that R7RS bit again β "fail catastrophically" is not a drill π
π SEE ALSO π
make-bytevector(3scm)β the one that actually makes the bytevectors, since this page just checks for them
β STANDARDS β
R6RS, R7RS πΈ
π¦ HISTORY π¦
R6RS is the first Scheme report to have bytevectors. before that? no bytevectors. wild, honestly π
π 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 bye bestie, go check your bytevectors π this was bytevector?(3scm) from the Scheme Programmer's Manual, dated 2021-01-17 β mwah, love that for us πβ¨
π¦ where this page comes from
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2021 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms