Metatables

getnamecallmethod

Returns the current namecall method string when one is available, otherwise nil.

Syntax

getnamecallmethod(): string | nil
Aliases get_namecall_method

Returns

NameTypeDescription
methodstring | nilCurrent namecall method string when present; otherwise nil.

Description

Returns the current namecall method string when one is available, otherwise nil. The function takes no arguments and does not compute a method name from a target object. get_namecall_method is an alias.

Call it without parameters. The function reads the needed context from the current runtime state.

It returns method (string | nil). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Read the current L->namecall string when Real is inside namecall handling.

local method = getnamecallmethod()
print(method)

local aliasMethod = get_namecall_method()
print(aliasMethod)