&body macro arguments. Close #7
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
(defmacro year [num &rest body]
|
||||
(defmacro year [num &body body]
|
||||
`(#when ,(symbol (+ "year" (symbolNameValue num)))
|
||||
(print (+ "year " (Std.string ,num)))
|
||||
,@body))
|
||||
|
||||
(defmacro day [num &rest body]
|
||||
(defmacro day [num &body body]
|
||||
`(#when ,(symbol (+ "day" (symbolNameValue num)))
|
||||
(print (+ "day " (Std.string ,num)))
|
||||
,@body))
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
(defmethod _index [x y]
|
||||
(+ x (* y width)))
|
||||
|
||||
(defmacro withIndex [idxName xName yName &rest body]
|
||||
(defmacro withIndex [idxName xName yName &body body]
|
||||
`(let [,idxName (_index ,xName ,yName)]
|
||||
,@body))
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
random Std.random
|
||||
int Std.int)))
|
||||
|
||||
(defmacro withValueOrInputBox [v &rest body]
|
||||
(defmacro withValueOrInputBox [v &body body]
|
||||
`(if ,v
|
||||
{,@body}
|
||||
(awaitLet [,v (inputBox)]
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
(set lastCollector (_composeArgCollector collectedArgs arg lastCollector)))
|
||||
(lastCollector)))
|
||||
|
||||
(defmacro defcommand [name args &rest body]
|
||||
(defmacro defcommand [name args &body body]
|
||||
(let [argPairs
|
||||
(groups (expList args) 2)
|
||||
methodArgs
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
// Retrieve multiple components from an Entity with mutable access.
|
||||
// All components will be serialized after the block is done.
|
||||
(defmacro withWritableComponents [archive e bindings &rest body]
|
||||
(defmacro withWritableComponents [archive e bindings &body body]
|
||||
(let [bindingPairs
|
||||
(groups (expList bindings) 2 Throw)
|
||||
bindingList
|
||||
@@ -49,7 +49,7 @@
|
||||
,@saveList
|
||||
,retValSymbol)))
|
||||
|
||||
(defmacro withWritableEntry [archive e &rest body]
|
||||
(defmacro withWritableEntry [archive e &body body]
|
||||
(let [retValSymbol
|
||||
(symbol)]
|
||||
`(let [,retValSymbol {,@body}]
|
||||
|
||||
Reference in New Issue
Block a user