Object and class inspection functions
Benct Philip Jonsson edited this page May 8, 2021
·
1 revision
Pages 17
Clone this wiki locally
These are some functions for class/object inspection:
| Function | Purpose |
|---|---|
is_object |
Check if a value is a class or object. |
is_class |
Check if a value is a class. |
is_instance |
Check if a value is a (sub)class or an instance of a (sub)class |
is_object(value [, name, ...])
Returns:
-
falseifvalueis not an object or class, i.e. is not a table or does not have a field__classwhich is a table. - else with one argument: the name of (the class of)
value, i.evalue.__class.__name. - else with 2+ arguments: the name of (the class of)
valueif it equals one of the extra arguments, or elsenil.