Skip to content

Commit

Permalink
Fix example for fresh variables
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Sep 28, 2023
1 parent 9a56ae5 commit 5500dc8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/syntax_and_semantics/macros/fresh_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,20 @@ Additionally, fresh variables with respect to some other AST node can be declare
macro fresh_vars_sample(*names)
# First declare vars
{% for name, index in names %}
print "Declaring: ", "%name{index}", '\n'
print "Declaring: ", stringify(%name{index}), '\n'
%name{index} = {{index}}
{% end %}
# Then print them
{% for name, index in names %}
print "%name{index}: ", %name{index}, '\n'
print stringify(%name{index}), ": ", %name{index}, '\n'
{% end %}
end
macro stringify(var)
{{ var.stringify }}
end
fresh_vars_sample a, b, c
# Sample output:
Expand Down

0 comments on commit 5500dc8

Please sign in to comment.