Time Nick Message 07:18 MinetestBot 02[git] 04sfan5 -> 03minetest/minetest: [no sq] Move shaders & remove dead Irrlicht tests (#15006) 13b010714 https://github.com/minetest/minetest/commit/b0107144261f6513bbde95323c9663a71ed8f3c9 (152024-08-19T07:17:52Z) 23:40 ireallyhateirc Is there a discount "dump" that will only dump limited info? 23:41 ireallyhateirc or maybe what's the good practice for errors when a wrong argument is passed to a function? 23:42 ireallyhateirc I have pretty fat objects with tangled/circular references and printing them can stuck Minetest for long 23:46 MTDiscord dump is not optimized 23:47 MTDiscord such pretty printing is usually intended for debugging, i wouldn't do that as part of error messages. keep those simple and to the point, when the error arises, the debugging programmer can insert printf debugging or use other debugging tools as they please. 23:48 ireallyhateirc Ok so just "argument 'a' has type 'function' but 'number' expected" ? 23:49 MTDiscord you could always try another format like json or minetest.serialize, and just add the prettiness in post-processing after you find the messages in your logs 23:50 ireallyhateirc my objects are huge. Like a linked list of 100 points huge, where each point also has the path object linked 23:50 MTDiscord ireallyhateirc: if you want that level of granularity, sure. but often littering everything with type checks in a duck-typed language is overkill and a waste of time tbh. 23:51 ireallyhateirc I add type checks into object constructors usually 23:52 ireallyhateirc that way I catch errors early, instead of later in some unrelated code 23:52 ireallyhateirc Also some errors tell users they did a stupid thing and should not do that 23:55 MTDiscord To an extent type checks can be helpful, especially if the data flow isn't clear, or if you want to be especially helpful towards your users. Just don't litter your code with them. And if you really want types generally, maybe look into statically type checking Lua preprocessors.