-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.lisp
27 lines (23 loc) · 1.13 KB
/
package.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;;;; SPDX-FileCopyrightText: Atlas Engineer LLC
;;;; SPDX-License-Identifier: BSD-3-Clause
(uiop:define-package :prompter
(:use :common-lisp)
(:import-from :nclasses #:define-class)
(:import-from :serapeum #:export-always))
(in-package prompter)
(eval-when (:compile-toplevel :load-toplevel :execute)
(trivial-package-local-nicknames:add-package-local-nickname :alex :alexandria)
(trivial-package-local-nicknames:add-package-local-nickname :sera :serapeum))
(defmacro define-function (name args &body body)
"Eval ARGS then define function over the resulting lambda list.
All ARGS are declared as `ignorable'."
(let ((evaluated-args (eval args)))
`(defun ,name ,evaluated-args
(declare (ignorable ,@(set-difference (mapcar (lambda (arg) (if (listp arg) (first arg) arg))
evaluated-args)
lambda-list-keywords)))
,@body)))
(export-always '*debug-on-error*)
(defvar *debug-on-error* nil
"When non-nil, the Lisp debugger is invoked when a condition is raised.
Otherwise all errors occuring in threads are demoted to warnings.")