The 'for i in ...' loop inside parsing macro

2022-03-18 Thread ynfle
You don't need to quote anything with a ` in a template

The 'for i in ...' loop inside parsing macro

2022-03-17 Thread elcritch
You mixed up the variable `i` in the quote section. You only want to interpolate (``i``) for variables created outside the quote section: macro foo(c: char, s: string) = result = quote do: echo `s` for i in `s`: if i == `c`: echo `c` Run

The 'for i in ...' loop inside parsing macro

2022-03-17 Thread mardiyah
How do we have `for i in` loop inside quote do macro due to this keep on error: macro foo(c :char; s :string) = result = quote do: var i :char echo `s` for `i` in `s`: if `i`==`c` : echo `c` foo('l', "hello") Run