Skip to content
Snippets Groups Projects
Commit 3f527f53 authored by wlott's avatar wlott
Browse files

Replaced %primitive structure-ref with the magic function structure-ref.

And use structure-length to find the length of a structure.
parent 26795bb1
No related branches found
No related tags found
No related merge requests found
......@@ -23,17 +23,13 @@
;;; Define this now so that EQUAL works:
;;;
(defun pathnamep (x)
(and (structurep x)
(eq (%primitive structure-ref x 0)
'pathname)))
(and (structurep x) (eq (structure-ref x 0) 'pathname)))
;;; Define so that we can test for VOLATILE-INFO-ENVs from the beginning of
;;; initialization.
;;;
(defun volatile-info-env-p (x)
(and (structurep x)
(eq (%primitive structure-ref x 0)
'volatile-info-env)))
(and (structurep x) (eq (structure-ref x 0) 'volatile-info-env)))
(deftype inlinep ()
......@@ -46,23 +42,21 @@
(in-package "KERNEL")
(defun ctype-p (thing)
(and (structurep thing)
(member (%primitive structure-ref thing 0)
(member (structure-ref thing 0)
'(ctype hairy-type named-type numeric-type array-type
member-type structure-type union-type args-type
values-type function-type))))
(defun values-type-p (thing)
(and (structurep thing)
(eq (%primitive structure-ref thing 0) 'values-type)))
(and (structurep thing) (eq (structure-ref thing 0) 'values-type)))
;;; Define this so that we can copy type-class structures before the defstruct
;;; for type-class runs. ### It relies on structures being identical to
;;; simple-vectors so that the length can be extracted from the -1'st slot.
;;; for type-class runs.
;;;
(defun copy-type-class (tc)
(let ((new (make-type-class)))
(dotimes (i (truly-the index (%primitive structure-ref tc -1)))
(dotimes (i (c::structure-length tc))
(declare (type index i))
(%primitive structure-index-set new i
(%primitive structure-index-ref tc i)))
(setf (c::structure-ref new i)
(c::structure-ref tc i)))
new))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment