Changeset 7823


Ignore:
Timestamp:
Dec 5, 2007, 1:46:50 PM (13 years ago)
Author:
gb
Message:

REQUIRE-TYPE deals with fuzzier cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/sysutils.lisp

    r7624 r7823  
    303303
    304304
    305 ;This is like check-type, except it returns the value rather than setf'ing
    306 ;anything, and so can be done entirely out-of-line.
    307 (defun require-type (arg type) 
    308   (if (typep  arg type)
    309     arg
    310     (%kernel-restart $xwrongtype arg type)))
     305;;; This is like check-type, except it returns the value rather than setf'ing
     306;;; anything, and so can be done entirely out-of-line.
     307(defun require-type (arg type)
     308  (multiple-value-bind (win sure)
     309      (ctypep  arg (specifier-type type))
     310    (if (or win (not sure))
     311      arg
     312      (%kernel-restart $xwrongtype arg type))))
    311313
    312314;;; Might want to use an inverted mapping instead of (satisfies ccl::obscurely-named)
Note: See TracChangeset for help on using the changeset viewer.