Skip to content

Commit

Permalink
New component containing code for patching environment E5.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-strandh committed Sep 17, 2020
1 parent 317d6d2 commit f1c74e3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Code/Boot/Phase-8/patch-environment.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(cl:in-package #:sicl-boot-phase-8)

(defun maybe-patch-accessor-method (accessor-method e5)
(flet ((fun (name)
(sicl-genv:fdefinition name e5)))
(unless (typep (funcall (fun 'sicl-clos:method-function) accessor-method)
'sicl-boot::header)
(let* ((slot-definition
(funcall (fun 'sicl-clos:accessor-method-slot-definition)
accessor-method))
(slot-name
(funcall (fun 'sicl-clos:slot-definition-name) slot-definition)))
(funcall (fun 'reinitialize-instance)
accessor-method
:function
(funcall (fun 'compile)
nil
`(lambda (arguments next-methods)
(declare (ignore next-methods))
,(if (eq (funcall (fun 'class-of) accessor-method)
(sicl-genv:find-class 'sicl-clos:standard-reader-method e5))
`(slot-value (car arguments) ',slot-name)
`(setf (slot-value (cadr arguments) ',slot-name)
(car arguments))))))
(setf (slot-value slot-definition 'sicl-boot::%class)
(sicl-genv:find-class 'sicl-clos:standard-direct-slot-definition e5))))))



1 change: 1 addition & 0 deletions Code/Boot/Phase-8/sicl-boot-phase-8.asd
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
(:file "load-sicl-utilities")
(:file "define-compile")
(:file "boot")
(:file "patch-environment")
(:file "check-environment")
(:file "load-sequence-functions")))

0 comments on commit f1c74e3

Please sign in to comment.