diff options
author | Thanos Apollo <[email protected]> | 2024-03-03 02:20:18 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-03-03 02:20:18 +0200 |
commit | 90c2775f05adcc870758a5ac4ae7b8d51ce9d1d9 (patch) | |
tree | c1008d6433c5d3b6f9e6733bea3a958ba720a49c /gnosis.el | |
parent | 1ea40b35feb7fd710c7621058bb25bd14356e80a (diff) |
Add gnosis-assert-float-or-nil
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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. |