From effabd80dfd9146f870bc68ef150f4c57b58e937 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 23 Jun 2022 12:58:19 -0500 Subject: [add] defvarf --- hyperquirks.lisp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'hyperquirks.lisp') 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) -- cgit v1.2.3