summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-06-23 12:58:19 -0500
committerColin Okay <colin@cicadas.surf>2022-06-23 12:58:19 -0500
commiteffabd80dfd9146f870bc68ef150f4c57b58e937 (patch)
tree1546e18253331ee5e66bfe55e7dab26b9984a5ee
parent1ee29b34f0b5132023a1684f4624312112184b57 (diff)
[add] defvarf
-rw-r--r--hyperquirks.lisp9
1 files changed, 7 insertions, 2 deletions
diff --git a/hyperquirks.lisp b/hyperquirks.lisp
index bb99819..36029e2 100644
--- a/hyperquirks.lisp
+++ b/hyperquirks.lisp
@@ -4,6 +4,11 @@
;;; MACROS
+(defmacro defvarf (var &optional val doc)
+ `(progn
+ (defvar ,var nil ,doc)
+ (setf ,var ,val)))
+
(defmacro imperative (&body body)
"Evaluate expressins in BODY in sequence. Expressions that look
like (:= VAR1 EXPR1 ...) will expand into a LET* form whose bindings
@@ -80,9 +85,9 @@ NIL
4
"
(let* ((tmpvar
- (gensym))
+ (gensym "TEMP"))
(block-name
- (gensym))
+ (gensym "BLOCK"))
(body
(loop for a in accessors
collect `(when (funcall ',test ,tmpvar)