From e138a14569dd589dba05c6e01b426718e52b9d60 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sun, 25 Feb 2007 18:00:10 +0200 Subject: [PATCH] required-argument --- alexandria.asd | 1 + errors.lisp | 7 +++++++ package.lisp | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 errors.lisp diff --git a/alexandria.asd b/alexandria.asd index 675f62c..d129ff0 100644 --- a/alexandria.asd +++ b/alexandria.asd @@ -5,6 +5,7 @@ ((:static-file "LICENCE") (:static-file "tests.lisp") (:file "package") + (:file "errors" :depends-on ("package")) (:file "hash-tables" :depends-on ("package")) (:file "macros" :depends-on ("package")) (:file "symbols" :depends-on ("package")) diff --git a/errors.lisp b/errors.lisp new file mode 100644 index 0000000..1117447 --- /dev/null +++ b/errors.lisp @@ -0,0 +1,7 @@ +(in-package :alexandria) + +(defun required-argument (&optional name) + "Signals an error for a missing argument of NAME. Intended for +use as an initialization form for structure and class-slots, and +a default value for required keyword arguments." + (error "Required argument~@[~S ~] missing." name)) diff --git a/package.lisp b/package.lisp index a1fc674..813abc0 100644 --- a/package.lisp +++ b/package.lisp @@ -81,4 +81,6 @@ ;; Types #:of-type #:type= + ;; Errors + #:required-argument )) -- 2.11.4.GIT