Add multiline echo macro example

This commit is contained in:
Mamy André-Ratsimbazafy 2020-04-21 18:54:42 +02:00
parent 9ff1e441ab
commit 02ab74ac8b
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
1 changed files with 13 additions and 0 deletions

13
multiline_echo.nim Normal file
View File

@ -0,0 +1,13 @@
import macros
macro echoAll(body: untyped): untyped =
result = newStmtList()
for s in body:
result.add newCall(bindSym"echo", s)
echoAll:
"Hello"
"World"
1234