>From fdcf69a0f0a9c9fa98360c5956c8875b1cb5d282 Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Mon, 15 Feb 2016 22:20:20 +1300 Subject: [PATCH 4/4] Specialize `not` for true/false and add hardcoded result types This could also be accomplished by making `not` a #:predicate for false, but the scrutiny message for predicates refers specifically to a "predicate" returning true or false, which might be confusing for `not`. --- types.db | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types.db b/types.db index c8accdc..bcbf531 100644 --- a/types.db +++ b/types.db @@ -54,7 +54,9 @@ ;; scheme (not (#(procedure #:pure #:foldable) not (*) boolean) - (((not boolean)) (let ((#(tmp) #(1))) '#f))) + ((true) (false) (let ((#(tmp) #(1))) '#f)) + ((false) (true) (let ((#(tmp) #(1))) '#t)) + (((not boolean)) (false) (let ((#(tmp) #(1))) '#f))) (boolean? (#(procedure #:pure #:predicate boolean) boolean? (*) boolean)) -- 2.7.0.rc3