mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 23:32:17 -08:00
Provide compiler macros for the slot accessors of the root classes.
This commit is contained in:
parent
e8f57bdec6
commit
2c3feb09d5
1 changed files with 15 additions and 0 deletions
|
|
@ -114,3 +114,18 @@
|
|||
(when (si::fixnump index)
|
||||
(c1expr `(si::instance-set ,(second args) ,index ,(first args))))))))))
|
||||
|
||||
(progn .
|
||||
#.(loop for var in '(clos::+standard-generic-function-slots+
|
||||
clos::+standard-method-slots+
|
||||
clos::+standard-class-slots+
|
||||
clos::+class-slots+)
|
||||
for slot-list = (symbol-value var)
|
||||
nconc
|
||||
(loop for i from 0
|
||||
for slot-definition in slot-list
|
||||
for accessor = (cadr (member :accessor slot-definition))
|
||||
when accessor
|
||||
collect `(define-compiler-macro ,accessor (&whole whole obj &environment env)
|
||||
(if (policy-inline-slot-access-p env)
|
||||
`(si::instance-ref ,obj ,,i)
|
||||
whole)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue