Skip to content

__index metatable for class methods #13

@stewart-codes

Description

@stewart-codes

Hi Yonaba, I really like your class system! However, all the LCS methods like extends, is_A, getSubClasses, etc. are put right into the tables for instances of my class. You pollute my instances' tables with LCS library methods instead of tucking them away in the __index metatable where I believe they belong. Looking over your code, it looks like you reserve the __index table for inheritance. Perhaps there is another solution in which you set __index to a function that accesses the base class as well as LCS methods? I'd love to here you're thoughts on this design decision. Thanks!

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