You need to lookup what WARN
actually does. By default it prints a warning. If you want to have access to the condition object, you need to write a handler. Just returning from the handler already continues then. If you want to get rid of the printed warning, then call MUFFLE-WARNING
in the handler. MUFFLE-WARNing
uses the restart of the same name.
CL-USER 32 > (let ((conditions ))
(handler-bind ((t (lambda (c) (push c conditions))))
(warn "foo")
(warn "bar")
(format t "~%baz"))
conditions)
Warning: foo
Warning: bar
baz
(#<SIMPLE-WARNING 402011C9B3> #<SIMPLE-WARNING 402011C63B>)