aboutsummaryrefslogtreecommitdiff
path: root/examples/tutorial.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-14 05:44:55 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-14 05:44:55 -0700
commit2cf8a96c703b1019195803d40c8c468562cdc8b5 (patch)
treef107505e666a1bae8a1c053444194350c2279734 /examples/tutorial.nom
parentf0a3c983e40fe7260be090638209321510e575e0 (diff)
Fixed out-of-order invocation args.
Diffstat (limited to 'examples/tutorial.nom')
-rw-r--r--examples/tutorial.nom11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/tutorial.nom b/examples/tutorial.nom
index 59aed28..7106f94 100644
--- a/examples/tutorial.nom
+++ b/examples/tutorial.nom
@@ -45,6 +45,17 @@ rule "get x from %dict":
is the return value.
return (%dict's "x")
+# Functions can have aliases, which may or may not have the arguments in different order
+rule [..]
+ "I hate %worse-things more than %better-things", "I think %worse-things are worse than %better-things"
+ "I like %better-things more than %worse-things"
+..:
+ say ".."|\%better-things capitalized\ rule and \%worse-things\ drool!
+
+I like "dogs" more than "cats"
+I think "chihuahuas" are worse than "corgis"
+
+
#.. Function calls can have parts of the function's name spread throughout.
Everything that's not a literal value is treated as part of the function's name
say both "Hello" and also "again!"