lua-users home
lua-l archive

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


On 10/9/07, David Given <dg@cowlark.com> wrote:
> The upshot of this is, if you add an __iter metatable entry to allow
> iteration on tables, you also add a nasty ambiguity as to what happens
> if the table has both a __call *and* an __iter. That's not to say it
> can't be done... just that ambiguities like this are best avoided if you
> wish to retain your sanity.

I had forgotten about the __call trick. Sometimes when discussing some
obscure C++ feature Bjarne Stroustrup says  'this conversion was not
permitted because it can result in subtleties'. Well, having been a
C++ programmer for a decade, I think Lua should avoid too many
subtleties ;)

steve d.