[Ecls-list] make-load-form patch

Brian Spilsbury brian.spilsbury at gmail.com
Mon May 15 19:01:45 UTC 2006


This patch causes ecl to compile code using make-load-form.
There are no known problems, but it hasn't been tested much, so please
let me know of any problems which turn up.

The following code should compile and load correctly given the supplied patch.

--

(eval-when (:compile-toplevel)
 (defclass tree-with-parent ()
  ((parent
     :accessor tree-parent
     :initform nil)
   (children
     :initarg  :children
     :accessor tree-children
     :initform nil)))
 (defmethod make-load-form ((x tree-with-parent) &optional environment)
  (declare (ignore environment))
  (print x)
  (values
    ;; creation form
    `(make-instance ',(class-of x) :children ',(slot-value x 'children))
    ;; initialization form
    `(setf (tree-parent ',x) ',(slot-value x 'parent))
     ))

 (defvar s4 (make-instance 'tree-with-parent))
 (defvar s5 (make-instance 'tree-with-parent))

 (setf (tree-parent s5) s4)
 (setf (tree-children s4) (list s5)))

(defvar a '#.s5)
(defvar b '#.s4)
(defvar c '#.s5)

--

Regards,
Brian.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.7
Type: application/octet-stream
Size: 15136 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060515/b6bfb956/attachment.obj>


More information about the ecl-devel mailing list