diff --git a/docs/rpgdm-tables-dice.org b/docs/rpgdm-tables-dice.org index 6cd062f..766a12c 100644 --- a/docs/rpgdm-tables-dice.org +++ b/docs/rpgdm-tables-dice.org @@ -46,7 +46,7 @@ For instance, Xanathar's Guide to Everything, a Dungeons and Dragons supplement To represent these types of tables, we create a special type, called a =dice-table=. Where the first "slot" is the dice expression (or the number of sides of a dice to roll), and an associative list of result values and the choice. #+BEGIN_SRC emacs-lisp :results silent -(defstruct dice-table dice rows) +(cl-defstruct dice-table dice rows) #+END_SRC How is this used to render the example table above? diff --git a/docs/rpgdm-tables-freq.org b/docs/rpgdm-tables-freq.org index f511fb2..c09d072 100644 --- a/docs/rpgdm-tables-freq.org +++ b/docs/rpgdm-tables-freq.org @@ -226,7 +226,7 @@ decrement the ROLL value." ;; (message "Comparing %d <= %d for %s" roll num-elems tag) (if (<= roll num-elems) (return tag) - (decf roll num-elems)))) + (cl-decf roll num-elems)))) (ert-deftest rpgdm-tables--find-tag-test () (let ((weighted-tags diff --git a/rpgdm-dice.el b/rpgdm-dice.el index 02e7859..03f2daa 100644 --- a/rpgdm-dice.el +++ b/rpgdm-dice.el @@ -81,7 +81,7 @@ This really tests the `rpgdm--test-rolls' function." (8 1 8) (20 1 20) (100 1 100))) - (destructuring-bind (die lowest highest) test-data + (cl-destructuring-bind (die lowest highest) test-data (rpgdm--test-rolls #'rpgdm--roll-die (list die) lowest highest)))) ;; ---------------------------------------------------------------------- @@ -155,7 +155,7 @@ average value of AVG, if given." ((3 6 4) 7 22) ((4 6 4 "-") 0 20)))) (dolist (test-seq test-data) - (destructuring-bind (dice-args lowest highest) test-seq + (cl-destructuring-bind (dice-args lowest highest) test-seq (rpgdm--test-roll-series 'rpgdm--roll dice-args lowest highest))))) @@ -240,7 +240,7 @@ the following: ("2d12" 2 24) ("3d6+2" 5 20)))) (dolist (test-data test-cases) - (destructuring-bind (dice-expression lowest highest) test-data + (cl-destructuring-bind (dice-expression lowest highest) test-data (rpgdm--test-roll-series 'rpgdm--roll-expression (list dice-expression) lowest highest))))) diff --git a/rpgdm-tables-dice.el b/rpgdm-tables-dice.el index 6cd28a7..32b42f8 100644 --- a/rpgdm-tables-dice.el +++ b/rpgdm-tables-dice.el @@ -17,7 +17,7 @@ ;;; Code: -(defstruct dice-table dice rows) +(cl-defstruct dice-table dice rows) (defun rpgdm-tables--choose-dice-table (table) "Choose a string from a random dice table." diff --git a/rpgdm-tables-freq.el b/rpgdm-tables-freq.el index 8a7f807..b257b5d 100644 --- a/rpgdm-tables-freq.el +++ b/rpgdm-tables-freq.el @@ -142,7 +142,7 @@ decrement the ROLL value." ;; (message "Comparing %d <= %d for %s" roll num-elems tag) (if (<= roll num-elems) (return tag) - (decf roll num-elems)))) + (cl-decf roll num-elems)))) (ert-deftest rpgdm-tables--find-tag-test () (let ((weighted-tags diff --git a/rpgdm.el b/rpgdm.el index 9d75c12..68044e3 100644 --- a/rpgdm.el +++ b/rpgdm.el @@ -109,7 +109,7 @@ and ARGS are substitued values." Meant to be used with `rpgdm-last-results-previous'." (interactive) (when (> rpgdm-last-results-ptr 0) - (decf rpgdm-last-results-ptr)) + (cl-decf rpgdm-last-results-ptr)) (message "%d> %s" rpgdm-last-results-ptr (ring-ref rpgdm-last-results rpgdm-last-results-ptr))) (defun rpgdm-paste-last-message ()