Verified Commit 1704422e authored by Vladimir Sedach's avatar Vladimir Sedach
Browse files

Made definition of ps-once-only easier to read

parent 5c9b1e73
...@@ -368,10 +368,13 @@ gensym-prefix-string)." ...@@ -368,10 +368,13 @@ gensym-prefix-string)."
(defmacro ps-once-only ((&rest vars) &body body) (defmacro ps-once-only ((&rest vars) &body body)
"Helper macro for writing Parenscript macros. Useful for preventing unwanted multiple evaluation." "Helper macro for writing Parenscript macros. Useful for preventing unwanted multiple evaluation."
(let ((gensyms (mapcar (lambda (x) (ps-gensym (string x))) vars))) (let ((gensyms (mapcar #'ps-gensym vars)))
`(let ,(mapcar (lambda (g v) `(,g (ps-gensym ,(string v)))) gensyms vars) `(let ,(mapcar (lambda (g v) `(,g (ps-gensym ',v)))
`(let* (,,@(mapcar (lambda (g v) ``(,,g ,,v)) gensyms vars)) gensyms vars)
,(let ,(mapcar (lambda (g v) `(,v ,g)) gensyms vars) `(let* (,,@(mapcar (lambda (g v) `(list ,g ,v))
gensyms vars))
,(let ,(mapcar (lambda (g v) (list v g))
gensyms vars)
,@body))))) ,@body)))))
(defmacro maybe-once-only ((&rest vars) &body body) (defmacro maybe-once-only ((&rest vars) &body body)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment