melee-roguelite/sample-macros.fnl

14 lines
241 B
Plaintext
Raw Normal View History

(fn incf [value ?by]
`(set ,value (+ ,value (or ,?by 1))))
(fn decf [value ?by]
`(set ,value (+ ,value (or ,?by 1))))
(fn with [t keys ?body]
`(let [,keys ,t]
(if ,?body
,?body
,keys)))
{: incf : decf : with}