From f0aed2231f077a05f3bcb95cf332dd75866dc9aa Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 22 Nov 2023 07:18:59 -0800 Subject: updated parenscript client gen; added body variables to endpoints --- src/macros.lisp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/macros.lisp') diff --git a/src/macros.lisp b/src/macros.lisp index 0d941b6..fe2c6cc 100644 --- a/src/macros.lisp +++ b/src/macros.lisp @@ -47,3 +47,15 @@ first mapped with the PARSER function." collect `(,name (when ,name (funcall ',(second (assoc name params)) ,name)))) ,@body)))) +(defmacro let-body ((&rest var-names) &body body) + (let ((key (gensym "key")) + (val (gensym "val")) + (var (gensym "var"))) + `(derrida:with-plist + ,var-names + (loop :for (,key ,val) :on (request-body) :by #'cddr + :for ,var := (find ,key ',var-names :test #'string-equal) + :when ,var :collect ,var :and :collect ,val) + ,@body))) + + -- cgit v1.2.3