Skip to content

__namecall not called on tables #230

Answered by zeux
morgoth990 asked this question in Q&A
Discussion options

You must be logged in to vote

Canonically in Lua (and Luau preserves this behavior), obj:method(args) is equivalent to (obj[method])(obj, args), -- to expose methods on the object, usually you'd have the __index metamethod point to a table with methods, or a C function that returns a function based on the method name. This should still work for tables and userdata alike. __namecall is currently an embedding feature that can accelerate method calls implemented in C/C++, and that's also why it doesn't work on tables - to make sure that we have some freedom to change the behavior if necessary.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by morgoth990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants