~ chicken-core (chicken-5) 7507cba67e8b2aaec2e8f88f6e7111cfc0b39e4a
commit 7507cba67e8b2aaec2e8f88f6e7111cfc0b39e4a Author: Evan Hanson <evhan@foldling.org> AuthorDate: Mon Feb 15 22:20:20 2016 +1300 Commit: Peter Bex <peter@more-magic.net> CommitDate: Sat Jun 18 16:31:47 2016 +0200 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`. Signed-off-by: Peter Bex <peter@more-magic.net> diff --git a/types.db b/types.db index 784dcf29..51bc883a 100644 --- a/types.db +++ b/types.db @@ -51,7 +51,9 @@ ;; scheme (not (#(procedure #:pure) 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))Trap