Changeset 102
- Timestamp:
- Dec 10, 2003, 12:22:43 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/ccl/level-1/l1-clos-boot.lisp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/level-1/l1-clos-boot.lisp
r99 r102 20 20 ; l1-clos-boot.lisp 21 21 22 22 23 (in-package :ccl) 23 24 … … 149 150 ;;; Map slot-names (symbols) to SLOT-ID objects (which contain unique indices). 150 151 (let* ((slot-id-lock (make-lock)) 151 (next-slot-index 0)152 (next-slot-index 1) ; 0 is never a valid slot-index 152 153 (slot-id-hash (make-hash-table :test #'eq :weak t))) 153 154 (defun ensure-slot-id (slot-name) … … 156 157 (or (gethash slot-name slot-id-hash) 157 158 (setf (gethash slot-name slot-id-hash) 158 (%istruct 'slot-id slot-name (incf next-slot-index)))))) 159 (%istruct 'slot-id slot-name (prog1 160 next-slot-index 161 (incf next-slot-index))))))) 159 162 (defun current-slot-index () next-slot-index) 160 163 ) 164 165 166 (defun %slot-id-lookup-obsolete (instance slot-id) 167 (update-obsolete-instance instance) 168 (funcall (%wrapper-slot-id->slotd (instance.class-wrapper instance)) 169 instance slot-id)) 170 (defun slot-id-lookup-no-slots (instance slot-id) 171 (declare (ignore instance slot-id))) 172 173 (defun %slot-id-ref-obsolete (instance slot-id) 174 (update-obsolete-instance instance) 175 (funcall (%wrapper-slot-id-value (instance.class-wrapper instance)) 176 instance slot-id)) 177 (defun %slot-id-ref-missing (instance slot-id) 178 (slot-missing (class-of instance) instance (slot-id.name slot-id) 'slot-value)) 179 180 (defun %slot-id-set-obsolete (instance slot-id new-value) 181 (update-obsolete-instance instance) 182 (funcall (%wrapper-set-slot-id-value (instance.class-wrapper instance)) 183 instance slot-id new-value)) 184 185 (defun %slot-id-set-missing (instance slot-id new-value) 186 (slot-missing (class-of instance) instance (slot-id.name slot-id) '(setf slot-value) new-value)) 161 187 162 188 … … 2299 2325 (find-slotd name slots))) 2300 2326 2301 ;;; Stupid, temporary definitions that miss the point completely: 2327 2302 2328 (defun slot-id-value (instance slot-id) 2303 (slot-value instance (slot-id.name slot-id))) 2329 (let* ((wrapper (if (eq (typecode instance) ppc32::subtag-instance) 2330 (instance.class-wrapper instance) 2331 (%class.own-wrapper (class-of instance))))) 2332 (funcall (%wrapper-slot-id-value wrapper) instance slot-id))) 2304 2333 2305 2334 (defun set-slot-id-value (instance slot-id value) 2306 (set-slot-value instance (slot-id.name slot-id) value)) 2335 (let* ((wrapper (if (eq (typecode instance) ppc32::subtag-instance) 2336 (instance.class-wrapper instance) 2337 (%class.own-wrapper (class-of instance))))) 2338 (funcall (%wrapper-set-slot-id-value wrapper) instance slot-id value))) 2307 2339 2308 2340 ; returns nil if (apply gf args) wil cause an error because of the
Note:
See TracChangeset
for help on using the changeset viewer.
