Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The meaninglessness of interfaces. Need "class" keyword. #810

Closed
b0ryakha opened this issue Oct 9, 2024 · 1 comment
Closed

The meaninglessness of interfaces. Need "class" keyword. #810

b0ryakha opened this issue Oct 9, 2024 · 1 comment
Labels
feature request New feature or request

Comments

@b0ryakha
Copy link

b0ryakha commented Oct 9, 2024

There is almost no point in interfaces, I would like to get a "class" to use inheritance of objects, more precisely functions.

Yes, interfaces eliminate duplication of declarations of methods and class fields, but their abstraction makes it necessary to duplicate the functions of the base class for all inheritors.

If the base record has at least 3 methods and we have at least 2 inheritors, then we need to do 2*3 function duplications.
Although there are no such problems in ordinary lua, it turns out that tl, on the contrary, causes pain.

I really like Teal and I would like to be able to use "inheritance" without such restrictions.

@hishamhm hishamhm added the feature request New feature or request label Oct 10, 2024
@hishamhm
Copy link
Member

Closing as a duplicate of #97. There are no plans to introduce a class keyword. You can avoid n*m implementations of functions via metatables, as is customary in Lua.

@hishamhm hishamhm closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants