From bf37295faeb9535c56671f4b2050260e1b88cd32 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 15 Jan 2019 15:53:31 -0800 Subject: Updating to v6.15, which includes "external (...)" instead of separate 'externally' versions of stuff, and some auto-formatting. --- lib/core/io.nom | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'lib/core/io.nom') 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()) -- cgit v1.2.3