diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-11-07 15:55:38 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-11-07 17:10:50 -0700 |
commit | 84b50eb38f6ffe2c454998318ca6e36a3123a3d5 (patch) | |
tree | 09ec0b5d0fb6c6a937b055f2b6bd82f258171c32 /org-d20.el | |
parent | cfbd4ae7343733b508feaf453b91facd1d0fb44d (diff) | |
download | org-d20-84b50eb38f6ffe2c454998318ca6e36a3123a3d5.tar.gz |
avoid using s-blank?
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'org-d20.el')
-rw-r--r-- | org-d20.el | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -417,13 +417,17 @@ the best N of them, e.g., 4d6k3." ;; Concat b onto a as a signed term, where a is possibly empty (defun org-d20--rolls-concat (sign a b) - (if (>= sign 0) - (if (s-blank? a) - b - (concat a " + " b)) - (if (s-blank? a) - (concat "- " b) - (concat a " - " b)))) + (let (strings) + (if (or (null a) (string= "" a)) + (unless (>= sign 0) + (push " - " strings)) + (push a strings) + (push (if (>= sign 0) + " + " + " - ") + strings)) + (push b strings) + (apply #'concat (nreverse strings)))) ;; Bracket a number so it looks a bit like a dice roll result (defun org-d20--rolls-bracket (sides roll) |