list-copy(3scm)
πΈ NAME πΈ
okay so bestie, this is list-copy from the Scheme Programmer's Manual (3scm), and it is literally the βcopy a listβ procedure. main character energy for list duplication, no cap. π
β¨
π LIBRARY π
(import (scheme base)) ;R7RS
β¨ SYNOPSIS β¨
(list-copy obj)
π DESCRIPTION π
So list-copy returns a newly allocated copy of the given obj if it is a list. π«Ά Only the pairs themselves get copied β the cars of the result are the same in the eqv?(3scm) sense as the cars of the original list. If obj is an improper list, the result is improper too, and the final cdrs are the same in the eqv?(3scm) sense. And if obj is not a list? It comes back unchanged, bestie. periodt.
π RETURN VALUES π
Returns a single value. One value, no extras, iconic behavior. β¨
π EXAMPLES π
(define a '(1 8 2 8)) ; a may be immutable
(define b (list-copy a))
(set-car! b 3) ; b is mutable
b => (3 8 2 8)
a => (1 8 2 8)
π¦ COMPATIBILITY π¦
This procedure is unique to R6RS. An alternative is to write (map values obj). iykyk π
π¨ ERRORS π¨
π¨ It is an error if the wrong number of arguments was passed or an argument was outside its domain. It is an error if obj is a circular list. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically. not the catastrophic fail, bestie π
π SEE ALSO π
map(3scm)vector-copy(3scm)
β STANDARDS β
R7RS. that's it. slay. π
π°οΈ HISTORY π°οΈ
This procedure is new in R7RS. fresh out the R7RS oven π₯
π 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/. The legends behind the docs π«Ά
okay that's the whole list-copy(3scm) page, bestie β from the Scheme Programmer's Manual, dated 2023-08-13 π«Άπβ¨
π¦ where this page comes from
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2023 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms