diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-15 15:53:31 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-15 15:54:28 -0800 |
| commit | bf37295faeb9535c56671f4b2050260e1b88cd32 (patch) | |
| tree | d544b68bca8c5bdf0926cc20a12f925c1761cfda /lib/core/io.nom | |
| parent | ef70abe4b7ed8d04574ab24ea4fd74fe2a64221f (diff) | |
Updating to v6.15, which includes "external (...)" instead of separate
'externally' versions of stuff, and some auto-formatting.
Diffstat (limited to 'lib/core/io.nom')
| -rw-r--r-- | lib/core/io.nom | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/lib/core/io.nom b/lib/core/io.nom index 7afe889..90cfbd4 100644 --- a/lib/core/io.nom +++ b/lib/core/io.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V6.14 +#!/usr/bin/env nomsu -V6.15.13.8 # This file contains basic input/output code @@ -6,24 +6,25 @@ use "core/metaprogramming" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -(say $message) compiles to: - lua> (" - if \$message.type == "Text" then - return LuaCode("say(", \($message as lua expr), ");"); - else - return LuaCode("say(tostring(", \($message as lua expr), "));"); - end - ") - -(say $message inline) compiles to: - 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 - ") - -externally (ask $prompt) means: - $io.write $prompt - return ($io.read()) +external: + (say $message) compiles to: + lua> (" + if \$message.type == "Text" then + return LuaCode("say(", \($message as lua expr), ");"); + else + return LuaCode("say(tostring(", \($message as lua expr), "));"); + end + ") + + (say $message inline) compiles to: + 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 + ") + + (ask $prompt) means: + $io.write $prompt + return ($io.read()) |
