mutation...........

Posted by superguay on Stack Overflow See other posts from Stack Overflow or by superguay
Published on 2010-06-06T17:18:41Z Indexed on 2010/06/06 17:22 UTC
Read the original article Hit count: 370

Filed under:

Hey everybody,

I'm kinda confused.....

(define m (list 1 2 3 '(5 8)))
(let ((l (cdr m)))
(set! l '(28 88))) ==>(1 2 3 (5 8))

(define o (list 1 2 3 '(5 8)))
(let ((l (cdr o)))
(set-car! l '(28 88))) ==> (1 (28 88) 3 (5 8))

Why does (set! l '(28 88))) not update m?

© Stack Overflow or respective owner

Related posts about plt-scheme