We Recommend

The Scheme Programming Language The Scheme Programming Language
This thoroughly updated edition of The Scheme Programming Language provides an introduction to Scheme and a definitive reference for standard Scheme, presented in a clear and concise manner. Written for professionals and students with some prior programming experience, it begins by leading the programmer gently through the basics of Scheme and continues with an introduction to some of the more advanced features of the language.


Posted By

ikfjwe on 10/14/08


Tagged

identifier


Versions (?)


cons


Published in: Scheme 


cons is not destructive.

  1. (setq alist '(a b c))
  2. ;(a b c)
  3. (cons '1 alist)
  4. ;(1 a b c)
  5. (prin1 alist)
  6. ;(a b c)
  7.  
  8. (setq alist (cons '1 alist))
  9. (prin1 alist)
  10. ;(1 a b c)

Report this snippet 

You need to login to post a comment.