Return to Snippet

Revision: 5233
at March 13, 2008 03:42 by jarnaldich


Updated Code
;;; Save
(defun save-obj (filename obj)
  (with-open-file (out filename
                   :direction :output
                   :if-exists :supersede)
    (with-standard-io-syntax
      (print obj out))))

;;; Load
(defun load-obj (filename obj)
  (with-open-file (in filename)
    (with-standard-io-syntax
      (setf obj (read in)))))

Revision: 5232
at February 29, 2008 11:02 by jarnaldich


Updated Code
;;; Save
(defun save-db (filename obj)
  (with-open-file (out filename
                   :direction :output
                   :if-exists :supersede)
    (with-standard-io-syntax
      (print obj out))))

;;; Load
(defun load-db (filename obj)
  (with-open-file (in filename)
    (with-standard-io-syntax
      (setf obj (read in)))))

Revision: 5231
at February 29, 2008 11:00 by jarnaldich


Updated Code
;;; Save
(defun save-db (filename obj)
  (with-open-file (out filename
                   :direction :output
                   :if-exists :supersede)
    (with-standard-io-syntax
      (print db out))))

;;; Load
(defun load-db (filename obj)
  (with-open-file (in filename)
    (with-standard-io-syntax
      (setf db (read in)))))

Revision: 5230
at February 21, 2008 02:23 by jarnaldich


Initial Code
;;; Save
(defun save-db (filename db)
  (with-open-file (out filename
                   :direction :output
                   :if-exists :supersede)
    (with-standard-io-syntax
      (print db out))))

;;; Load
(defun load-db (filename db)
  (with-open-file (in filename)
    (with-standard-io-syntax
      (setf db (read in)))))

Initial URL

                                

Initial Description
Example of serializing a lisp variable.

Initial Title
Serializing in Lisp

Initial Tags
file

Initial Language
Lisp