Skip to content

Commit 98448bd

Browse files
committed
make moon.p print all arguments after dumping them
1 parent 3db3ec8 commit 98448bd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

moon/init.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ do
88
getfenv, setfenv, dump = _obj_0.getfenv, _obj_0.setfenv, _obj_0.dump
99
end
1010
local p, is_object, type, debug, run_with_scope, bind_methods, defaultbl, extend, copy, mixin, mixin_object, mixin_table, fold
11-
p = function(...)
12-
return print(dump(...))
11+
p = function(o, ...)
12+
print(dump(o))
13+
if select("#", ...) > 0 then
14+
return p(...)
15+
end
1316
end
1417
is_object = function(value)
1518
return lua.type(value) == "table" and value.__class

moon/init.moon

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import getfenv, setfenv, dump from require "moonscript.util"
44

55
local *
66

7-
p = (...) ->
8-
print dump ...
7+
p = (o, ...) ->
8+
print dump o
9+
if select("#", ...) > 0
10+
p ...
911

1012
is_object = (value) -> -- is a moonscript object
1113
lua.type(value) == "table" and value.__class

0 commit comments

Comments
 (0)