Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed late inversion of class readers. This has been broken since

implementation for all Lisps except ECL.
  • Loading branch information...
commit d1cccd72e7d55ee8bff1bf29b1ce9f3c66fc4c04 1 parent 95033e2
Zach Kost-Smith authored
Showing with 21 additions and 20 deletions.
  1. +19 −18 modf.lisp
  2. +2 −2 package.lisp
View
37 modf.lisp
@@ -277,24 +277,25 @@ functions ahead of time."
(slot-groups (mapcar #'closer-mop:class-direct-slots
(closer-mop:class-precedence-list class) ))
(new-instance (make-instance class))
- slot-found )
- (loop
- for slots in slot-groups do
- (loop
- for slot in slots do
- (cond ((member func (closer-mop:slot-definition-readers slot))
- (setf slot-found t
- (slot-value new-instance
- (closer-mop:slot-definition-name slot) )
- new-val ))
- ((and (not slot-found)
- (slot-boundp obj (closer-mop:slot-definition-name slot)) )
- (setf (slot-value new-instance (closer-mop:slot-definition-name
- slot ))
- (slot-value obj (closer-mop:slot-definition-name slot)) ))
- ((not slot-found)
- (slot-makunbound new-instance
- (closer-mop:slot-definition-name slot) )))))
+ encounted-slots )
+ (iter
+ (for slots in slot-groups)
+ (iter
+ (for slot in slots)
+ (unless (member slot encounted-slots)
+ (cond ((and
+ (member func (closer-mop:slot-definition-readers slot)) )
+ (setf (slot-value new-instance
+ (closer-mop:slot-definition-name slot) )
+ new-val ))
+ ((slot-boundp obj (closer-mop:slot-definition-name slot))
+ (setf (slot-value new-instance (closer-mop:slot-definition-name
+ slot ))
+ (slot-value obj (closer-mop:slot-definition-name slot)) ))
+ (t (slot-makunbound
+ new-instance
+ (closer-mop:slot-definition-name slot) ))))
+ (push slot encounted-slots) ))
new-instance ))
;; <<>>=
View
4 package.lisp
@@ -1,7 +1,7 @@
(defpackage :modf
- (:use :cl)
- (:import-from :alexandria #:with-gensyms)
+ (:use :cl :iterate)
+ (:import-from :alexandria #:with-gensyms)
(:export #:modf
#:modf-eval
#:modf-fn
Please sign in to comment.
Something went wrong with that request. Please try again.