aboutsummaryrefslogtreecommitdiff
path: root/lib/training_wheels.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/training_wheels.nom')
-rw-r--r--lib/training_wheels.nom9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/training_wheels.nom b/lib/training_wheels.nom
index 2845768..100927c 100644
--- a/lib/training_wheels.nom
+++ b/lib/training_wheels.nom
@@ -1,9 +1,10 @@
-#!/usr/bin/env nomsu -V2.4.4.3
+#!/usr/bin/env nomsu -V2.5.4.3
#
This file contains a set of definitions that bring some familiar language features
from other languages into nomsu (e.g. "==" and "continue")
use "core"
+
parse [%a == %b] as (%a = %b)
parse [%a == %b] as (%a is %b)
parse [%a ~= %b, %a != %b, %a <> %b] as (%a is not %b)
@@ -35,11 +36,13 @@ compile [function %args %body, lambda %args %body] to:
to %lua write ")\n "
%body = (%body as lua)
lua> "\%body:convert_to_statements('return ');"
- for % in %args.value: lua> "\%body:remove_free_vars(\%);"
+ for % in %args.value:
+ lua> "\%body:remove_free_vars(\%);"
+
to %lua write %body
to %lua write "\nend)"
return %lua
parse [function %name %args %body] as (%name = (function %args %body))
compile [call %fn %args] to (..)
- Lua value "\(%fn as lua expr)(unpack(\(%args as lua expr)))" \ No newline at end of file
+ Lua value "\(%fn as lua expr)(unpack(\(%args as lua expr)))"