hoelzro / lua-repl

A Lua REPL implemented in Lua for embedding in other programs
MIT License
172 stars 16 forks source link

Pretty print cannot handle function #19

Closed dpashkevich closed 11 years ago

dpashkevich commented 11 years ago

Thanks for working on the repl!

You're probably aware of this but I'm opening this issue just for the record. The pretty_print plugin throws an error when trying to pretty print a function:

...plugins/pretty_print.lua:184: Cannot print type 'function'

There should at least be some sort of stub for this so the repl is usable for debugging, since many real-world tables would contain functions...

hoelzro commented 11 years ago

@dpashkevich Thanks for looking at the REPL, and reporting this issue! I have been thinking about a more general way to handle this issue, but in the meantime, I have fixed this issue. Expect a release to follow shortly!

dpashkevich commented 11 years ago

I just came across inspect.lua (also available via luarocks). You may want to use it for your plugin.

hoelzro commented 11 years ago

@dpashkevich Thanks for the suggestion! I'll investigate inspect.lua.

hoelzro commented 11 years ago

@dpashkevich I took a look at inspect.lua, and I think that I'll stick with the pretty printer bundled with the lua-repl source to avoid additional external dependencies. However, if you prefer the way inspect.lua does things, you may certainly write a lua-repl plugin to use it!

dpashkevich commented 11 years ago

Thanks for letting know. I didn't really look into inspect.lua's dependencies, I just randomly came across it on luarocks while searching for a generic inspect function to use in debugging. I'll be happy to use whatever you come up with in lua-repl :)