skypher/cl-store — pull request #2 by lmj (2013-04-03 23:34:53+00:00)
Title: Fix LispWorks structure-object format incompatibility

(ql:quickload :flexi-streams)
(ql:quickload :cl-store)

(defstruct foo x)

(defparameter *foo* (make-foo :x 3))

(defparameter *seq* (flexi-streams:with-output-to-sequence (out)
(cl-store:store *foo* out)))

(defun seq->obj (seq)
(flexi-streams:with-input-from-sequence (in seq)
(cl-store:restore in)))

(defun self-check ()
(equalp *foo* (seq->obj *seq*)))

Manually copying LispWorks' value of `*seq*` and pasting it into `(seq->obj )` on SBCL or CLL or Allegro gives

Number of slots restored does not match slots stored.
[Condition of type SIMPLE-ERROR]

The reverse direction produces a nonsensical error on LispWorks,

LOOP repeat counter X not a number.
[Condition of type CONDITIONS:SIMPLE-PROGRAM-ERROR]

Tested on LW Personal Edition 6.0 and 6.1.