Skip to content

Commit

Permalink
Fix: Compiler note undefined type
Browse files Browse the repository at this point in the history
Define error condition before usage.
  • Loading branch information
kilianmh committed May 8, 2024
1 parent d009833 commit f5920e7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/locatives/base.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@
calling 40ANTS-DOC/REFERENCE-API:CANONICAL-REFERENCE on it will return the same reference.
For extension only, don't call this directly."))

(define-condition locate-error (error)
((message :initarg :message :reader locate-error-message)
(object :initarg :object :reader locate-error-object)
(locative :initarg :locative :reader locate-error-locative))
(:documentation "Signaled by LOCATE when the lookup fails and ERRORP
is true.")
(:report (lambda (condition stream)
(format stream "~@<Could not locate ~A ~A.~@[ ~A~]~:@>"
(locate-error-locative condition)
(locate-error-object condition)
(locate-error-message condition)))))

(defun locate-error (&rest format-and-args)
"Call this function to signal a LOCATE-ERROR condition from a
LOCATE-OBJECT generic-function. FORMAT-AND-ARGS contains a format string and
Expand Down Expand Up @@ -84,18 +96,6 @@
(error 'locate-error :message (locate-error-message e)
:object object :locative locative)))))

(define-condition locate-error (error)
((message :initarg :message :reader locate-error-message)
(object :initarg :object :reader locate-error-object)
(locative :initarg :locative :reader locate-error-locative))
(:documentation "Signaled by LOCATE when the lookup fails and ERRORP
is true.")
(:report (lambda (condition stream)
(format stream "~@<Could not locate ~A ~A.~@[ ~A~]~:@>"
(locate-error-locative condition)
(locate-error-object condition)
(locate-error-message condition)))))


(defgeneric locate-and-find-source (object locative-type locative-args)
(:documentation
Expand Down

0 comments on commit f5920e7

Please sign in to comment.