aboutsummaryrefslogtreecommitdiff
path: root/core/io.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-12-30 19:04:34 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-12-30 19:04:45 -0800
commit8a3c32408733a2f5e14f8a2dbafa3f980b2f73a1 (patch)
tree68f1e8a8b956c33ed24cc7a6a369fd97b8849321 /core/io.nom
parent359152da1772ce501609edd8f84b4985ed3e42f2 (diff)
Update to new syntax.
Diffstat (limited to 'core/io.nom')
-rw-r--r--core/io.nom17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/io.nom b/core/io.nom
index 4bf2028..1d8bac4 100644
--- a/core/io.nom
+++ b/core/io.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V5.12.12.8
+#!/usr/bin/env nomsu -V6.12.12.8
#
This file contains basic input/output code
@@ -7,25 +7,28 @@ use "core/metaprogramming.nom"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(say $message) compiles to:
- lua> "
+ lua> ("
if \$message.type == "Text" then
return LuaCode("say(", \($message as lua expr), ");");
else
return LuaCode("say(tostring(", \($message as lua expr), "));");
- end"
+ end
+ ")
(say $message inline) compiles to:
- lua> "
+ lua> ("
if \$message.type == "Text" then
return LuaCode("io.write(", \($message as lua expr), ")");
else
return LuaCode("io.write(tostring(", \($message as lua expr), "))");
- end"
+ end
+ ")
(ask $prompt) compiles to:
- lua> "
+ lua> ("
if \$prompt.type == "Text" then
return LuaCode("(io.write(", \($prompt as lua expr), ") and io.read())");
else
return LuaCode("(io.write(tostring(", \($prompt as lua expr), ")) and io.read())");
- end"
+ end
+ ")