aboutsummaryrefslogtreecommitdiff
path: root/examples/tutorial.nom
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tutorial.nom')
-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!"