Ignore:
Timestamp:
Oct 15, 2010, 3:15:03 AM (9 years ago)
Author:
gb
Message:

Admit that the macro CCL::REPORT-BAD-ARG has accepted exactly 2 arguments
for the last 20+ years. If the second argument (the typespec) is quoted,
warn at macroexpand time if it looks suspicious.

Fix a handful of cases that were detected by that change. In one
case, introduce a predicate so that EXPT can complain about an
argument whose realpart isn't positive via a SATISFIES type specifier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/macros.lisp

    r14362 r14365  
    264264          ,@(if ret `((progn (setq ,varsym nil) ,ret))))))))
    265265
    266 (defmacro report-bad-arg (&rest args)
    267   `(values (%badarg ,@args)))
     266(defmacro report-bad-arg (&whole w thing typespec &environment env)
     267  (when (quoted-form-p typespec)
     268    (unless (ignore-errors (specifier-type-if-known (cadr typespec) env))
     269      (warn "Unknown type specifier ~s in ~s." (cadr typespec) w)))
     270  `(values (%badarg ,thing ,typespec)))
    268271
    269272(defmacro %cons-restart (name action report interactive test)
Note: See TracChangeset for help on using the changeset viewer.