aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-27 18:28:23 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-27 18:29:23 -0700
commit2e15c0fd5067318601e2f3b70ee6fc16ef58200d (patch)
tree0006e0825b2680d457bb531c3d079661b16d6bc8 /examples
parent6ce32bdd25694d71dc232c50a008f8824f8a75ce (diff)
Some tweaks/cleanup on the nomsu code as well as adding variable
mangling to 'parse % as %' to make almost hygienic macros.
Diffstat (limited to 'examples')
-rw-r--r--examples/how_do_i.nom8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/how_do_i.nom b/examples/how_do_i.nom
index 13517fc..5269996 100644
--- a/examples/how_do_i.nom
+++ b/examples/how_do_i.nom
@@ -17,17 +17,17 @@ use "core"
say "Hello world!"
# How do I set a variable?
-%x <- 1
+%foobar <- 1
%str <- "Hello world"
# Expressions that are more than just literal values require parentheses:
-%x <- (2 + 3)
+%foobar <- (2 + 3)
%one-two <- 12
say %one-two
# How do I modify a variable?
-%x <- (%x + 1)
+%foobar <- (%foobar + 1)
# Or, as a shorthand, you can do this to increment a variable:
-%x +<- 1
+%foobar +<- 1
# How do I define a mutli-line string?
%mutli-str <- ".."