mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-17 14:51:20 -08:00
Compiler macros optimize first, second,...
This commit is contained in:
parent
f26a13885e
commit
7a2678acb2
2 changed files with 9 additions and 11 deletions
|
|
@ -120,6 +120,15 @@
|
|||
(t whole))
|
||||
whole))
|
||||
|
||||
;;;
|
||||
;;; FIRST, SECOND, THIRD, ...
|
||||
;;;
|
||||
|
||||
(progn .
|
||||
#.(loop for n in '(first second third fourth fifth sixth seventh eighth ninth tenth)
|
||||
for i from 0
|
||||
collect `(define-compiler-macro ,n (x) (list 'nth ,i x))))
|
||||
|
||||
;;;
|
||||
;;; POP
|
||||
;;;
|
||||
|
|
|
|||
|
|
@ -360,17 +360,6 @@
|
|||
(def-inline nth :unsafe (t t) t "ecl_nth(fix(#0),#1)")
|
||||
(def-inline nth :unsafe (fixnum t) t "ecl_nth(#0,#1)")
|
||||
|
||||
(def-inline first :always (t) t "ecl_car(#0)")
|
||||
(def-inline second :always (t) t "ecl_cadr(#0)")
|
||||
(def-inline third :always (t) t "ecl_caddr(#0)")
|
||||
(def-inline fourth :always (t) t "ecl_cadddr(#0)")
|
||||
|
||||
(def-inline first :unsafe (cons) t "ECL_CONS_CAR(#0)")
|
||||
(def-inline first :unsafe (t) t "_ecl_car(#0)")
|
||||
(def-inline second :unsafe (t) t "_ecl_cadr(#0)")
|
||||
(def-inline third :unsafe (t) t "_ecl_caddr(#0)")
|
||||
(def-inline fourth :unsafe (t) t "_ecl_cadddr(#0)")
|
||||
|
||||
(def-inline rest :always (t) t "ecl_cdr(#0)")
|
||||
(def-inline rest :unsafe (cons) t "ECL_CONS_CDR(#0)")
|
||||
(def-inline rest :unsafe (t) t "_ecl_cdr(#0)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue