Skip to content

Commit

Permalink
Signal an error if there is no extent
Browse files Browse the repository at this point in the history
  • Loading branch information
ruricolist committed Sep 7, 2024
1 parent af9f26d commit 56c0397
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions defer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
(car *guarded-extents*))

(defun find-guarded-extent (extent)
(etypecase extent
(null (first *guarded-extents*))
(symbol (cdr (assoc extent *guarded-extents* :key #'guarded-extent-name)))
(guarded-extent extent)))
(or (etypecase extent
(null (first *guarded-extents*))
(symbol (cdr (assoc extent *guarded-extents* :key #'guarded-extent-name)))
(guarded-extent extent))
(error "No extent: ~a" extent)))

(declaim (inline %make-extent-guard))
(defstruct-read-only (extent-guard (:constructor make-extent-guard (thunk)))
Expand Down

0 comments on commit 56c0397

Please sign in to comment.