Changeset 10533


Ignore:
Timestamp:
Aug 22, 2008, 2:13:33 PM (11 years ago)
Author:
gb
Message:

Print invalid arg counts using ~P.

Add %CHECK-TYPE (called from macroexpansion of CHECK-TYPE in the
trunk), but I don't think that the macro has yet been changed
to use it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/l1-error-system.lisp

    r9854 r10533  
    216216                    "few")))
    217217        (if too-many
    218           (format s "Too many arguments in call to ~s:~&~d arguments provided, at most ~d accepted. " fn scaled-nargs max)
    219           (format s "Too few arguments in call to ~s:~&~d arguments provided, at least ~d required. " fn  scaled-nargs min))))))
     218          (format s "Too many arguments in call to ~s:~&~d argument~:p provided, at most ~d accepted. " fn scaled-nargs max)
     219          (format s "Too few arguments in call to ~s:~&~d argument~:p provided, at least ~d required. " fn  scaled-nargs min))))))
    220220
    221221
     
    993993
    994994
    995 
     995(defun %check-type (value typespec placename typename)
     996  (let ((condition (make-condition 'type-error
     997                                   :datum value
     998                                   :expected-type typespec)))
     999    (if typename
     1000      (setf (slot-value condition 'format-control)
     1001            (format nil "value ~~S is not ~A (~~S)." typename)))
     1002    (restart-case (%error condition nil (%get-frame-ptr))
     1003                  (store-value (newval)
     1004                               :report (lambda (s)
     1005                                         (format s "Assign a new value of type ~a to ~s" typespec placename))
     1006                               :interactive (lambda ()
     1007                                              (format *query-io* "~&New value for ~S :" placename)
     1008                                              (list (eval (read))))
     1009                               newval))))
    9961010
    9971011; This has to be defined fairly early (assuming, of course, that it "has" to be defined at all ...
Note: See TracChangeset for help on using the changeset viewer.