aboutsummaryrefslogtreecommitdiffstats
path: root/lib/init.client.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-10-29 08:35:53 +0000
committers-ol <s-ol@users.noreply.github.com>2018-10-29 08:35:53 +0000
commit27d1cf641ce3bbfe96e6fe18f24dd46f95efbe5e (patch)
treeac703b9f84c1c8e4666d039a880a2af91c450c4a /lib/init.client.moon
parentmove duct_tape to lib (diff)
downloadmmm-27d1cf641ce3bbfe96e6fe18f24dd46f95efbe5e.tar.gz
mmm-27d1cf641ce3bbfe96e6fe18f24dd46f95efbe5e.zip
better conversion inverence for mmmfs
Diffstat (limited to 'lib/init.client.moon')
-rw-r--r--lib/init.client.moon21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/init.client.moon b/lib/init.client.moon
index c1aea07..d39143d 100644
--- a/lib/init.client.moon
+++ b/lib/init.client.moon
@@ -5,8 +5,25 @@ window = js.global
{ :document, :console } = window
MODE = 'CLIENT'
-print = console\log
-warn = console\warn
+
+deep_tostring = (tbl, space='') ->
+ buf = space .. tostring tbl
+
+ return buf unless 'table' == type tbl
+
+ buf = buf .. ' {\n'
+ for k,v in pairs tbl
+ buf = buf .. "#{space} [#{k}]: #{deep_tostring v, space .. ' '}\n"
+ buf = buf .. "#{space}}"
+ buf
+
+print = (...) ->
+ contents = [deep_tostring v for v in *{ ... } ]
+ console\log table.unpack contents
+
+warn = (...) ->
+ contents = [deep_tostring v for v in *{ ... } ]
+ console\warn table.unpack contents
package.path = '/?.shared.moon.lua;/?.client.moon.lua;/?.moon.lua;/?/init.moon.lua;/?.lua;/?/init.lua'