-
-
Notifications
You must be signed in to change notification settings - Fork 10
pprint
Jérôme Leclercq edited this page Dec 8, 2020
·
2 revisions
API: pprint
Prints its parameter to the execution output in a pretty way.
This function does the same as print but is able to pretty-print tables.
pprint(...)
-
...: Variadic parameters to print.
- This function takes variadic parameters, which means it can take from
0tonparameters. - All parameters are converted to string as if tostring (with the second parameter set to true) was called on them before passing them to this function.
- When called with more than one argument, each printed argument will be separated by a tabulation (
\tcharacter)
-- Prints "Hello world" to the output
pprint("Hello world")
-- Prints "true 1.24 str vec2(10, 20)" to the output
pprint(true, 1.24, "str", Vec2(10, 20))
--[[
Prints the table content:
{
1 = Hello
2 = World
key = value
}
]]
pprint({ "Hello", "World", key = "value" })