NV
(define alst '(("a" . 1) ("b" . 2)))
(set! alst (assoc-set! alst "a" 5))
=> In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): ("a" . 1)что ему может не нравиться?
Size: a a a
NV
ND
(define alst '(("a" . 1) ("b" . 2)))
(set! alst (assoc-set! alst "a" 5))
=> In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): ("a" . 1)AZ
ND
AZ
ND
(define p '("a" . 1))
(set-cdr! p 4)
p
=> ("a" . 4)NV
(define alst '(("a" . 1) ("b" . 2)))
scheme@(guile-user)> (assoc-set! alst "a" 5)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): ("a" . 1)
scheme@(guile-user)> (define alst (list (cons "a" 1) (cons "b" 2)))
scheme@(guile-user)> (assoc-set! alst "a" 5)
$1 = (("a" . 5) ("b" . 2))NV
NV
NV
AP
AP
ND
AP
AP
AP
ND
ND