chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Specialize memq, assq et al. of null to false


From: Evan Hanson
Subject: [Chicken-hackers] [PATCH] Specialize memq, assq et al. of null to false
Date: Fri, 1 May 2015 20:24:43 +1200

---
 types.db | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/types.db b/types.db
index fb8557e..ce07444 100644
--- a/types.db
+++ b/types.db
@@ -175,15 +175,18 @@
          ((null) (null) (let ((#(tmp) #(1))) '())))
 
 (memq (forall (a b) (#(procedure #:clean) memq (a (list-of b)) (or false 
(list-of b))))
+      ((* null) (let ((#(tmp) #(1))) '#f))
       ((* list) (##core#inline "C_u_i_memq" #(1) #(2))))
 
 (memv (forall (a b) (#(procedure #:clean) memv (a (list-of b)) (or false 
(list-of b))))
+      ((* null) (let ((#(tmp) #(1))) '#f))
       (((or symbol procedure immediate) list)
        (##core#inline "C_u_i_memq" #(1) #(2))))
 
 (member (forall (a b) (#(procedure #:clean) member
                       (a (list-of b) #!optional (procedure (b a) *)) ; sic
                       (or false (list-of b))))
+       ((* null) (let ((#(tmp) #(1))) '#f))
        (((or symbol procedure immediate) list)
         (##core#inline "C_u_i_memq" #(1) #(2)))
        ((* (list-of (or symbol procedure immediate)))
@@ -191,10 +194,12 @@
 
 (assq (forall (a b) (#(procedure #:clean) assq (* (list-of (pair a b)))
                     (or false (pair a b))))
+      ((* null) (let ((#(tmp) #(1))) '#f))
       ((* (list-of pair)) (##core#inline "C_u_i_assq" #(1) #(2))))
 
 (assv (forall (a b) (#(procedure #:clean) assv (* (list-of (pair a b))) 
                     (or false (pair a b))))
+      ((* null) (let ((#(tmp) #(1))) '#f))
       (((or symbol immediate procedure) (list-of pair))
        (##core#inline "C_u_i_assq" #(1) #(2)))
       ((* (list-of (pair (or symbol procedure immediate) *)))
@@ -203,6 +208,7 @@
 (assoc (forall (a b c) (#(procedure #:clean) assoc (a (list-of (pair b c))
                                                      #!optional (procedure (b 
a) *)) ; sic
                        (or false (pair b c))))
+       ((* null) (let ((#(tmp) #(1))) '#f))
        (((or symbol procedure immediate) (list-of pair))
        (##core#inline "C_u_i_assq" #(1) #(2)))
        ((* (list-of (pair (or symbol procedure immediate) *)))
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]