From a72ff678da253fce46e8e4648f6e4cf5ce1ea9b4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 10 Mar 2024 21:39:53 -0500 Subject: uh new start --- pp.lua | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'pp.lua') diff --git a/pp.lua b/pp.lua index 9c1a6d0..4d9d9af 100644 --- a/pp.lua +++ b/pp.lua @@ -1,21 +1,8 @@ --- lam.pp local pp = {} -table.unpack = table.unpack or unpack - -pp.luadump = - function (x) - end - -pp.luapp = function (x) print(pp.luadump(x)) end - -pp.lamdump = - function (x) - end - -pp.lampp = function (x) print(pp.lamdump(x)) end - --- The following should be at some point replaced by the preceding +local type = require "type" +local unpack = table.unpack or unpack function pp.dump (x, lvl) lvl = lvl or 0 @@ -23,7 +10,7 @@ function pp.dump (x, lvl) local output = "" --[[if getmetatable(x) and getmetatable(x).__tostring then output = output .. tostring(x) - else]]if type(x) == "table" then + else]]if type.luatype(x) == "table" then local subo = "" for k,v in pairs(x) do if v == x then @@ -46,8 +33,5 @@ function pp.pp (x) print(pp.dump(x)) end -return setmetatable(pp, { __call = - function(_, x) - return pp.pp(x) - end, -}) +--- +return pp -- cgit 1.4.1-21-gabe81