lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 16-Jun-07, at 3:39 PM, Matthew Armstrong wrote:

This thing is pretty f*%#ing cool!  Thanks for writing this.  It has more features, and is easier to use than what I was trying to do, so I'll definitely be using this.

One small point:  Is there a way to print a table?  You can print the keys, if you know them, but I didn't see a way of reflecting a table.

I have a special print function (called ppr), which prints the first level keys if the variable happens to be a table.  So I can say:

exec ppr(myVar)

This works ok for me, but I'm always looking for ways to lazyfy my typing.

The easiest way to do it is to replace the definition of output in ldb_config.lua. That method defaults to print(), but you can override
it to do anything you like (although I suggest maintaining something
like the semantics of print(), at least in the sense that it can
receive multiple values.)

It would be very easy to define a ppr command; I'm planning on
using that as an example of advanced ldb configuration, before
I actually do a beta release.