- Timestamp:
- Nov 24, 2007, 6:27:39 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/level-1/l1-clos-boot.lisp
r7301 r7727 920 920 (unless found (return)) 921 921 (when (cdr cell) 922 (funcall function name (c drcell)))))))922 (funcall function name (class-cell-class cell))))))) 923 923 924 924 … … 1173 1173 1174 1174 1175 1176 1175 1177 1176 1178 ;;;;;;;;;;;;;;;;;;;;;;;; Instances and classes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; … … 1179 1181 1180 1182 (defun class-cell-typep (form class-cell) 1181 (unless (listp class-cell)(error "puke")) 1182 (locally (declare (type list class-cell)) 1183 (let ((class (cdr class-cell))) 1183 (unless (istruct-typep class-cell 'class-cell) 1184 (report-bad-arg class-cell 'class-cell)) 1185 (locally (declare (type class-cell class-cell)) 1186 (let ((class (class-cell-class class-cell))) 1184 1187 (when (not class) 1185 (setq class (find-class (c arclass-cell) nil))1186 (when class ( rplacd class-cellclass)))1188 (setq class (find-class (class-cell-name class-cell) nil)) 1189 (when class (setf (class-cell-class class-cell) class))) 1187 1190 (if class 1188 1191 (not (null (memq class (%inited-class-cpl (class-of form))))) 1189 (if (fboundp 'typep)(typep form (c arclass-cell)) t)))))1192 (if (fboundp 'typep)(typep form (class-cell-name class-cell)) t))))) 1190 1193 1191 1194 1192 1195 1193 1196 (defun %require-type-class-cell (arg class-cell) 1194 ; sort of weird 1195 (if (or ;(not *type-system-initialized*) 1196 (not (listp class-cell))) ; bootstrapping prob no longer 1197 arg ; (progn (pushnew class-cell puke) arg) 1198 (if (class-cell-typep arg class-cell) 1199 arg 1200 (%kernel-restart $xwrongtype arg (car class-cell))))) 1197 (if (class-cell-typep arg class-cell) 1198 arg 1199 (%kernel-restart $xwrongtype arg (car class-cell)))) 1201 1200 1202 1201 … … 1206 1205 (or cell 1207 1206 (and create? 1208 (setf (gethash name %find-classes%) ( cons name nil))))))1207 (setf (gethash name %find-classes%) (make-class-cell name)))))) 1209 1208 1210 1209 1211 1210 (defun find-class (name &optional (errorp t) environment) 1212 1211 (let* ((cell (find-class-cell name nil))) 1213 (declare ( listcell))1214 (or ( cdr cell)1212 (declare (type class-cell cell)) 1213 (or (and cell (class-cell-class cell)) 1215 1214 (let ((defenv (and environment (definition-environment environment)))) 1216 1215 (when defenv … … 1227 1226 (if (eq name (%class.name class)) 1228 1227 (setf (info-type-kind name) :instance)) 1229 (setf (c dr (the cons cell)) class))1228 (setf (class-cell-class cell) class)) 1230 1229 class)) 1231 1230 … … 1266 1265 (setq name (require-type name 'symbol)) 1267 1266 (let ((cell (find-class-cell name class))) 1268 (declare (type listcell))1269 (let ((old-class (c drcell)))1267 (declare (type class-cell cell)) 1268 (let ((old-class (class-cell-class cell))) 1270 1269 (when old-class 1271 1270 (when (eq (%class.name old-class) name) … … 1276 1275 (when (null class) 1277 1276 (when cell 1278 (setf (c drcell) nil))1277 (setf (class-cell-class cell) nil)) 1279 1278 (return-from set-find-class nil)) 1280 1279 (setq class (require-type class 'class)) … … 1289 1288 (%deftype name nil nil)) 1290 1289 (setf (info-type-kind name) :instance)) 1291 (setf (c drcell) class)))1290 (setf (class-cell-class cell) class))) 1292 1291 ) ; end of queue-fixup 1293 1292 … … 1683 1682 (make-built-in-class 'intersection-ctype *ctype-class*) 1684 1683 1685 1684 (make-built-in-class 'class-cell *istruct-class*) 1686 1685 (make-built-in-class 'complex (find-class 'number)) 1687 1686 (make-built-in-class 'real (find-class 'number)) … … 1782 1781 1783 1782 (defun class-cell-find-class (class-cell errorp) 1784 (unless ( listpclass-cell)1785 (setq class-cell (%kernel-restart $xwrongtype class-cell ' list)))1786 (locally (declare (type listclass-cell))1787 (let ((class (c drclass-cell)))1783 (unless (istruct-typep class-cell 'class-cell) 1784 (setq class-cell (%kernel-restart $xwrongtype class-cell 'class-cell))) 1785 (locally (declare (type class-cell class-cell)) 1786 (let ((class (class-cell-class class-cell))) 1788 1787 (or class 1789 1788 (and 1790 (setq class (find-class (c arclass-cell) nil))1789 (setq class (find-class (class-cell-name class-cell) nil)) 1791 1790 (when class 1792 ( rplacd class-cellclass)1791 (setf (class-cell-class class-cell) class) 1793 1792 class)) 1794 (if errorp (error "Class ~s not found." (c arclass-cell)) nil)))))1793 (if errorp (error "Class ~s not found." (class-cell-name class-cell)) nil))))) 1795 1794 1796 1795 ;;; (%wrapper-class (instance.class-wrapper frob)) … … 2396 2395 (declare (dynamic-extent initargs)) 2397 2396 (apply #'make-instance 2398 (or (c dr class-cell) (car (the listclass-cell)))2397 (or (class-cell-class class-cell) (class-cell-name (the class-cell class-cell))) 2399 2398 initargs)) 2400 2399
Note:
See TracChangeset
for help on using the changeset viewer.
