/ Published in: Scheme
cons is not destructive.
Expand |
Embed | Plain Text
(setq alist '(a b c)) ;(a b c) (cons '1 alist) ;(1 a b c) (prin1 alist) ;(a b c) (setq alist (cons '1 alist)) (prin1 alist) ;(1 a b c)
Comments
Subscribe to comments
You need to login to post a comment.

This is common lisp code not scheme. Scheme has display function instead prin1 and define instead setq.