diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-09-13 09:54:12 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-09-13 09:54:12 -0600 |
commit | 2e284b71500a1f8dc6cc46ecf21eb1e9389ea780 (patch) | |
tree | e9227f4ad4e9987dcc64055803ab3e70a5e801ce /cl/src/utils | |
parent | 2cb14ebf79dd43aa96d54e65a0841d195d07bdf9 (diff) | |
download | cmath-2e284b71500a1f8dc6cc46ecf21eb1e9389ea780.tar.gz cmath-2e284b71500a1f8dc6cc46ecf21eb1e9389ea780.zip |
new table macro, notes for 9/11
Diffstat (limited to 'cl/src/utils')
-rw-r--r-- | cl/src/utils/package.lisp | 3 | ||||
-rw-r--r-- | cl/src/utils/table.lisp | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/cl/src/utils/package.lisp b/cl/src/utils/package.lisp index 0436a94..bdd5589 100644 --- a/cl/src/utils/package.lisp +++ b/cl/src/utils/package.lisp @@ -1,4 +1,5 @@ (in-package :cl-user) (defpackage lizfcm.utils (:use :cl) - (:export :within-range-p)) + (:export :within-range-p + :table)) diff --git a/cl/src/utils/table.lisp b/cl/src/utils/table.lisp new file mode 100644 index 0000000..e96f37b --- /dev/null +++ b/cl/src/utils/table.lisp @@ -0,0 +1,11 @@ +(in-package :lizfcm.utils) + +(defmacro table ((&key headers domain-order domain-values) &body body) + `(cons + ,headers + (mapcar (lambda (tuple) + (destructuring-bind ,domain-order tuple + (append tuple + (list + ,@body)))) + ,domain-values))) |