summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 6913cdf..fdf7516 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1242,6 +1242,14 @@ Insert deck values `ef-increase', `ef-decrease', `ef-threshold', `failure-factor
(unless (or (null value) (integerp value))
(error "Invalid value: %s, %s" value description)))
+(defun gnosis-assert-float-or-nil (value description &optional less-than-1)
+ "Assert that VALUE is a float or nil."
+ (if less-than-1
+ (unless (or (null value) (and (floatp value) (< value 1)))
+ (error "Invalid value: %s, %s" value description))
+ (unless (or (null value) (floatp value))
+ (error "Invalid value: %s, %s" value description))))
+
(cl-defun gnosis-edit-save-exit (&optional deck-edit (exit-func 'exit-recursive-edit) &rest args)
"Save edits and exit.