spec: vector primitives — bounds-checked ref/set!, vector-copy start/end slice
vector-ref and vector-set! now raise Eval_error on out-of-bounds index instead of an OCaml array exception. vector-copy accepts optional start and end parameters for slicing (R7RS §6.8). spec/primitives.sx doc updated to reflect slice params. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -227,9 +227,11 @@
|
||||
|
||||
(define-primitive
|
||||
"vector-copy"
|
||||
:params ((v :as vector))
|
||||
:params ((v :as vector)
|
||||
(start :as number :optional true)
|
||||
(end :as number :optional true))
|
||||
:returns "vector"
|
||||
:doc "Independent shallow copy.")
|
||||
:doc "Shallow copy of vector, optionally sliced from start (inclusive) to end (exclusive).")
|
||||
|
||||
(define-primitive
|
||||
"min"
|
||||
|
||||
Reference in New Issue
Block a user