RosettaCodeData/Task/Object-serialization/Common-Lisp/object-serialization-1.lisp
2023-07-01 13:44:08 -04:00

12 lines
434 B
Common Lisp

(defmacro with-serialization-to-file ((stream pathname) &body body)
`(with-open-file (,stream ,pathname
:element-type '(unsigned-byte 8)
:direction :output
:if-exists :supersede)
,@body))
(defclass entity ()
((name :initarg :name :initform "Some entity")))
(defclass person (entity)
((name :initarg :name :initform "The Nameless One")))