From eefbdec53afa05ea29c9cf71897c98ed72044136 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Sep 2017 04:36:32 -0700 Subject: [PATCH] Added some examples to the tutorial. --- examples/tutorial.nom | 5 +++++ 1 file changed, 5 insertions(+) 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!"