example:
defmacro(do_loop (:
stmts
while: condition), stmts: [Node], condition:
first_time = gensym()
# TODO - with splice:
# return quote(scope(:
# unquote(first_time) = True
# while (unquote(first_time) or unquote(condition):
# unquote(first_time) = False
# splice(stmts)
# )
# ))
# without splice:
while_stmts: mut:[Node] = [quote(unquote(first_time) = False)]
unsafe(while_stmts.insert(while_stmts.end(), stmts.begin(), stmts.end()))
while_block = Block(while_stmts)
return quote(scope(:
unquote(first_time) = True
while (unquote(first_time) or unquote(condition), unquote(while_block))
))
)
example: