[alexandria-devel] Signalling simple-errors

Stefan Lang langstefan at gmx.at
Sun May 6 13:44:01 UTC 2007


Hi,

Standard CL provides with the ERROR function a convenient way
to signal simple-errors, but (unless I've overlooked something)
things get verbose for simple-error subclasses.

E.g.

  (define-condition my-error (simple-error)
    ((arg
      :initarg :arg
      :initform nil)))

  (error 'my-error :arg "foo"
         :format-control "Something is wrong: ~A"
         :format-arguments (list xyz))

To tidy things up, I've written the SERROR function:

  (serror 'my-error :arg "foo"
          "Something is wrong: ~A" xyz)

  (serror 'my-error "Something is wrong: ~A" xyz)

  (serror 'my-error "Something is wrong.")

Of course I'm sending this because I'd like to have it in
Alexandria :-)

Thanks,
  Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: serror.patch
Type: text/x-diff
Size: 3831 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/alexandria-devel/attachments/20070506/d9b029f9/attachment.patch>


More information about the alexandria-devel mailing list