lua-users home
lua-l archive

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

> It was thus said that the Great Rena once stated:

>   Now, as to the difference between:
> 	syslog('error',"warning: x=%d",d)
> and
> 	syslog.error("warning: x=%d",d)
> is a matter of taste.  I prefer the former, as it's actually less code
> (one
> function vs. eight).  The later seems popular with the OO crowd (in my
> opinion).

Supporting the latter when you have the former
is just a matter of adding an __index metamethod
to a table. You can easily support both by having
both __index and __call.

Pierre Chapuis