/[flexichain]/flexichain/flexirank.lisp
ViewVC logotype

Diff of /flexichain/flexirank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by rkreuter, Thu Feb 9 02:51:06 2006 UTC revision 1.4 by charmon, Sun Jan 27 06:05:37 2008 UTC
# Line 58  Line 58 
58  (defclass flexirank-mixin () ())  (defclass flexirank-mixin () ())
59    
60  (defmethod move-elements :before ((chain flexirank-mixin) to from start1 start2 end2)  (defmethod move-elements :before ((chain flexirank-mixin) to from start1 start2 end2)
61      (declare (ignore to))
62    (loop for old from start2 below end2    (loop for old from start2 below end2
63          for new from start1          for new from start1
64          do (let ((element (aref from old)))          do (let ((element (aref from old)))
65               (when (typep element 'element-rank-mixin)               (when (typep element 'element-rank-mixin)
66                 (setf (index element) new)))))                 (setf (index element) new)))))
67    
68  (defmethod insert* :after ((chain flexirank-mixin) position (object element-rank-mixin))  (defmethod insert* :after ((chain flexirank-mixin) position (object element-rank-mixin))
69    (setf (index object) (position-index chain position)    (setf (index object) (position-index chain position)
70          (chain object) chain))          (chain object) chain))
71    
72  (defmethod (setf element*) :after ((object element-rank-mixin) (chain flexirank-mixin) position)  (defmethod (setf element*) :after ((object element-rank-mixin) (chain flexirank-mixin) position)
73    (setf (index object) (position-index chain position)    (setf (index object) (position-index chain position)
74          (chain object) chain))          (chain object) chain))
75    
76  (defmethod insert-vector* :after ((chain flexirank-mixin) position vector)  (defmethod insert-vector* :after ((chain flexirank-mixin) position vector)
77    (loop for elem across vector    (loop for elem across vector
78          for pos from position          for pos from position
79          do (setf (index elem) (position-index pos)          do (setf (index elem) (position-index chain pos)
80                   (chain elem) chain)))                   (chain elem) chain)))

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.5