Skip to content

Enabling static access with the _get meta method.#266

Open
Katsuya100 wants to merge 2 commits intoalbertodemichelis:masterfrom
Katsuya100:_get-metamethod-static-access
Open

Enabling static access with the _get meta method.#266
Katsuya100 wants to merge 2 commits intoalbertodemichelis:masterfrom
Katsuya100:_get-metamethod-static-access

Conversation

@Katsuya100
Copy link

@Katsuya100 Katsuya100 commented Feb 12, 2023

I would like to be able to implement the following to support C# and C++ static variable bindings.

class StaticGetSample
{
    function _get(key)
    {
        switch (key)
        {
            case "foo":
                return "a";
            case "bar":
                return "b";
        }
        return null;
    }
}

// output `a`.
print(StaticGetSample.foo);

Meta method call of SQClass was implemented with reference to the implementation of SQInstance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant