lua-users home
lua-l archive

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


On Sun, Dec 16, 2012 at 9:30 AM, Jorge Visca <xxopxe@gmail.com> wrote:
> Documented as "true enables, false disables, nil keeps as is. Returns the
> status as set". I expect it to be used with a "true" or "false" passed
> directly, not as result of some previous computation.
> enable()/disable()/is_ernabled() would work just as good in this case, but
> like this i have only one method vs 3.

I've seen plenty of C++ APIs that do this (STL and Boost use this
scheme) and it drives me bonkers. But as long as it's consistent, it
is at least well-defined, and I won't hold it against the library.

I don't know how well automatic documentation would work, but this
DOES sound like a really good case for implementing properties using
__index/__newindex.

/s/ Adam