Skip to content

Calls on member functions on superclasses create a lot of casts #11

Description

@fredreichbier

See https://github.com/fredreichbier/ooc-lua/blob/master/samples/cache.lua#L9:

When E.hello is called, howling actually asks the superclass, D for hello and gets a function. howling then returns a function that casts its first argument (this) to D* and otherwise relays the call to the function it got from D.

The problem: D does the same for C, which does the same for B, which does the same for A. So we end up with a function chain that casts its first argument to D* first, then C*, then B*, then A*. That's four nested functions and casts.

It's not pretty, and might actually cause performance problems.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions