aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nerv/init.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/nerv/init.lua b/nerv/init.lua
index 183ae6d..9c1a5c8 100644
--- a/nerv/init.lua
+++ b/nerv/init.lua
@@ -1,15 +1,19 @@
require 'libnerv'
-function nerv.error(fmt, ...)
- error("[nerv] internal error: " .. fmt .. "\n", ...)
-end
-
function nerv.error_method_not_implemented()
nerv.error("method not implemented");
end
+function nerv.sprintf(fmt, ...)
+ return string.format(fmt, ...)
+end
+
function nerv.printf(fmt, ...)
- io.write(string.format(fmt, ...))
+ io.write(nerv.sprintf(fmt, ...))
+end
+
+function nerv.error(fmt, ...)
+ error(nerv.sprintf("[nerv] internal error: " .. fmt .. "\n", ...))
end
function nerv.mesg_with_timestamp(fmt, ...)