lua-users home
lua-l archive

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


Tim:

On Tue, Feb 21, 2017 at 9:51 PM, Tim Hill <drtimhill@gmail.com> wrote:
> Yes, and of course I quoted the wrong part of the manual (see my later post and correction to Dirk).

No problem.

> In fact, I cannot really see any reason why __call should not handle callable either; its not really recursion, its more closer to the chaining that __index do. And of course in both cases it’s possible to setup cycles of metatables that will crash the VM.

This is what I was referring to. From what I read in the sources both
lua_call and lua_pcall and the call VM op end in a function which
errors ( longjmps? ) out when type is not function. I suppose it could
be made recursive ( or iterative via loop, end result is the same
disregarding stack consumption ). But this could introduce some kind
of very hard to trace bug (tm), so I'm not proposing it, but...

> However, I agree with your main point; this difference doesn’t seem to be made clear in the ref manual, so at the least it would be nice if this were updated to make this difference more clear.

... I would like to have this. And if the OTHER MM are going to work
with callables, state it too. Not a biggie, but a couple of lines in
the doc would, IMHO, improve it a lot.

Regards.
   Francisco Olarte.