From cea8d86a0de9416d64dcac5dc305faf9d696853b Mon Sep 17 00:00:00 2001 From: Evan Hanson
Date: Sat, 13 Feb 2016 23:51:07 +1300 Subject: [PATCH] Preserve type of first element in memq/memv procedure results If the result is a list, its first element will be the same type as the first procedure argument. --- types.db | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types.db b/types.db index 114aac1..aa38648 100644 --- a/types.db +++ b/types.db @@ -174,13 +174,13 @@ (reverse (forall (a) (#(procedure #:clean #:enforce) reverse ((list-of a)) (list-of a))) ((null) (null) (let ((#(tmp) #(1))) '()))) -(memq (forall (a) (#(procedure #:clean) memq (* (list-of a)) - (or false (list-of a)))) +(memq (forall (a b) (#(procedure #:clean) memq (a (list-of b)) + (or false (pair a (list-of b))))) ((* null) (let ((#(tmp) #(1))) '#f)) ((* list) (##core#inline "C_u_i_memq" #(1) #(2)))) -(memv (forall (a) (#(procedure #:clean) memv (* (list-of a)) - (or false (list-of a)))) +(memv (forall (a b) (#(procedure #:clean) memv (a (list-of b)) + (or false (pair a (list-of b))))) ((* null) (let ((#(tmp) #(1))) '#f)) (((or symbol procedure immediate) list) (##core#inline "C_u_i_memq" #(1) #(2)))) -- 2.7.0.rc3