orthecreedence / cl-async

Asynchronous IO library for Common Lisp.
MIT License
272 stars 40 forks source link

SBCL seems to dislike `define-condition-alias` #193

Closed rpgoldman closed 1 year ago

rpgoldman commented 1 year ago

When I load cl-async SBCL raises a bunch of warnings:

...
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:SOCKET-CLOSED
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:TCP-EOF
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:TCP-INFO
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:TCP-ERROR
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:TCP-RESET
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:TCP-TIMEOUT
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:TCP-REFUSED
WARNING: redefining DEFTYPE type to be a class: CL-ASYNC:TCP-ACCEPT-ERROR

I wonder if it would just be easier to redefine define-condition-alias as this instead:

(defmacro define-condition-alias (alias name)
  "Define an alias for the specified condition."
  `(define-condition ,alias (name)
      ()))

Yes, it adds a few more classes, but they are trivial, so maybe better do this instead of fighting the SBCL compiler? If you think this is worthwhile, I would be happy to submit an MR. But I will wait to see what you say first.