X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Falien-type.lisp;h=41a6e84cd0032eb4bc8746b1cc92330b058a2a40;hb=ce02ab2ecd9c6ae2e570abd8c93ebf3be55bbdad;hp=add7d74675f3e1b68ac9daa7f8bb53e4fdd72123;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/code/alien-type.lisp b/src/code/alien-type.lisp index add7d74..41a6e84 100644 --- a/src/code/alien-type.lisp +++ b/src/code/alien-type.lisp @@ -13,42 +13,46 @@ (in-package "SB!KERNEL") +(/show0 "code/alien-type.lisp 16") + (!begin-collecting-cold-init-forms) (defstruct (alien-type-type (:include ctype (class-info (type-class-or-lose 'alien))) - (:constructor %make-alien-type-type (alien-type))) + (:constructor %make-alien-type-type (alien-type)) + (:copier nil)) (alien-type nil :type alien-type)) -(define-type-class alien) +(!define-type-class alien) -(define-type-method (alien :unparse) (type) +(!define-type-method (alien :unparse) (type) `(alien ,(unparse-alien-type (alien-type-type-alien-type type)))) -(define-type-method (alien :simple-subtypep) (type1 type2) +(!define-type-method (alien :simple-subtypep) (type1 type2) (values (alien-subtype-p (alien-type-type-alien-type type1) (alien-type-type-alien-type type2)) t)) -;;; KLUDGE: This DEFINE-SUPERCLASSES gets executed much later than the others -;;; (toplevel form time instead of cold load init time) because ALIEN-VALUE -;;; itself is a structure which isn't defined until fairly late. +;;; KLUDGE: This !DEFINE-SUPERCLASSES gets executed much later than the +;;; others (toplevel form time instead of cold load init time) because +;;; ALIEN-VALUE itself is a structure which isn't defined until fairly +;;; late. ;;; ;;; FIXME: I'm somewhat tempted to just punt ALIEN from the type system. ;;; It's sufficiently unlike the others that it's a bit of a pain, and ;;; it doesn't seem to be put to any good use either in type inference or ;;; in type declarations. -(define-superclasses alien ((alien-value)) progn) +(!define-superclasses alien ((alien-value)) progn) -(define-type-method (alien :simple-=) (type1 type2) +(!define-type-method (alien :simple-=) (type1 type2) (let ((alien-type-1 (alien-type-type-alien-type type1)) (alien-type-2 (alien-type-type-alien-type type2))) (values (or (eq alien-type-1 alien-type-2) (alien-type-= alien-type-1 alien-type-2)) t))) -(def-type-translator alien (&optional (alien-type nil)) +(!def-type-translator alien (&optional (alien-type nil)) (typecase alien-type (null (make-alien-type-type)) @@ -66,3 +70,5 @@ *universal-type*)) (!defun-from-collected-cold-init-forms !alien-type-cold-init) + +(/show0 "code/alien-type.lisp end of file")