Changeset 10305


Ignore:
Timestamp:
11/01/05 01:55:45 (16 years ago)
Author:
piso
Message:

Signal type-errors properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/boole.lisp

    r3680 r10305  
    11;;; boole.lisp
    22;;;
    3 ;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: boole.lisp,v 1.1 2003-09-10 18:01:56 piso Exp $
     3;;; Copyright (C) 2003-2005 Peter Graves
     4;;; $Id: boole.lisp,v 1.2 2005-11-01 01:55:45 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    2020(defun boole (op n1 n2)
    2121  (unless (and (integerp n1) (integerp n2))
    22     (error 'type-error "BOOLE: ~s is not an integer"
    23            (if (integerp n1) n2 n1)))
     22    (error 'type-error
     23           :datum (if (integerp n1) n2 n1)
     24           :expected-type 'integer))
    2425  (case op
    2526    (#.boole-clr 0)
     
    4041    (#.boole-orc2 (logorc2 n1 n2))
    4142    (t
    42      (error 'type-error "BOOLE: invalid logical operation specifier: ~S" op))))
     43     (error 'type-error
     44            :datum op
     45            :expected-type (list 'integer #.boole-clr #.boole-orc2)))))
Note: See TracChangeset for help on using the changeset viewer.