We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Ballyhoo


Posted By

jarnaldich on 02/21/08


Tagged

file


Versions (?)


Serializing in Lisp


Published in: Lisp 


Example of serializing a lisp variable.


  1. ;;; Save
  2. (defun save-obj (filename obj)
  3. (with-open-file (out filename
  4. :direction :output
  5. :if-exists :supersede)
  6. (with-standard-io-syntax
  7. (print obj out))))
  8.  
  9. ;;; Load
  10. (defun load-obj (filename obj)
  11. (with-open-file (in filename)
  12. (with-standard-io-syntax
  13. (setf obj (read in)))))

Report this snippet 

You need to login to post a comment.