From fc0fb82757326c0835c4265878dbc5675eef4ade Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 1 Jan 2012 19:32:50 +0100 Subject: [PATCH] Type inference for LOGAND --- src/cmp/cmpopt-bits.lsp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cmp/cmpopt-bits.lsp b/src/cmp/cmpopt-bits.lsp index 991bc005b..e97bdde2c 100644 --- a/src/cmp/cmpopt-bits.lsp +++ b/src/cmp/cmpopt-bits.lsp @@ -70,3 +70,14 @@ (abs shift)) nil t))))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; TYPE PROPAGATION +;;; + +(def-type-propagator logand (a b) + (let ((output (dolist (int-type '((UNSIGNED-BYTE 8) FIXNUM) 'INTEGER) + (when (or (subtypep a int-type) + (subtypep b int-type)) + (return int-type))))) + (values (list a b) output)))