mes: Move pair? to core.
* src/lib.c (pair_p): New function. Gains 8% performance on MesCC.
This commit is contained in:
parent
5ed45a4e24
commit
67046e1b00
|
@ -42,7 +42,6 @@
|
|||
;; end boot-00.scm
|
||||
|
||||
;; boot-01.scm
|
||||
(define (pair? x) (eq? (core:type x) <cell:pair>))
|
||||
(define (not x) (if x #f #t))
|
||||
|
||||
(define (display x . rest)
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
;; end boot-00.scm
|
||||
|
||||
;; boot-01.scm
|
||||
(define (pair? x) (eq? (core:type x) <cell:pair>))
|
||||
(define (not x) (if x #f #t))
|
||||
|
||||
(define (display x . rest)
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
;; end boot-00.scm
|
||||
|
||||
;; boot-01.scm
|
||||
(define (pair? x) (eq? (core:type x) <cell:pair>))
|
||||
(define (not x) (if x #f #t))
|
||||
|
||||
(define (display x . rest)
|
||||
|
|
|
@ -75,9 +75,6 @@
|
|||
(define (number? x)
|
||||
(eq? (core:type x) <cell:number>))
|
||||
|
||||
(define (pair? x)
|
||||
(eq? (core:type x) <cell:pair>))
|
||||
|
||||
(define (port? x)
|
||||
(eq? (core:type x) <cell:port>))
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define (pair? x)
|
||||
(eq? (core:type x) <cell:pair>))
|
||||
|
||||
(define (atom? x)
|
||||
(if (pair? x) #f
|
||||
(if (null? x) #f
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define (pair? x) (eq? (core:type x) <cell:pair>))
|
||||
|
||||
(define (not x) (if x #f #t))
|
||||
|
||||
(define-macro (or . x)
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define (pair? x) (eq? (core:type x) <cell:pair>))
|
||||
(define (vector? x)
|
||||
(eq? (core:type x) <cell:vector>))
|
||||
|
||||
|
@ -85,7 +84,7 @@
|
|||
;; ((lambda (a d)
|
||||
;; (core:display " a=") (core:display a) (core:display "\n")
|
||||
;; (core:display " d=") (core:display d)
|
||||
|
||||
|
||||
;; (if (pair? d)
|
||||
;; (if (eq? (car d) 'quote)
|
||||
;; (if (and (pair? a) (eq? (car a) 'quote))
|
||||
|
@ -133,7 +132,7 @@
|
|||
(core:display "\n")
|
||||
(core:display "CDR d=") (core:display d)
|
||||
(core:display "\n")
|
||||
|
||||
|
||||
(if (pair? d)
|
||||
(if (eq? (car d) 'quote)
|
||||
(if (and (pair? a) (eq? (car a) 'quote))
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
(define <cell:pair> 7)
|
||||
(define <cell:string> 10)
|
||||
|
||||
(define (pair? x) (eq? (core:type x) <cell:pair>))
|
||||
(define (not x) (if x #f #t))
|
||||
|
||||
(define (display x . rest)
|
||||
|
|
Loading…
Reference in a new issue