aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-14 04:36:32 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-14 04:36:32 -0700
commiteefbdec53afa05ea29c9cf71897c98ed72044136 (patch)
treece535c9137ed54f763d13f97160bff1161d2ae69 /examples
parent88ff27148b6ec56cd2ba81931ee1bace04c17869 (diff)
Added some examples to the tutorial.
Diffstat (limited to 'examples')
-rw-r--r--examples/tutorial.nom5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/tutorial.nom b/examples/tutorial.nom
index 84f4a21..59aed28 100644
--- a/examples/tutorial.nom
+++ b/examples/tutorial.nom
@@ -40,6 +40,11 @@ rule "say both %first and also %second":
say %first
say %second
+rule "get x from %dict":
+ #.. Functions can return values explicitly, but if not, the last line in the function
+ is the return value.
+ return (%dict's "x")
+
#.. 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!"