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

Method inheritance handling #4

Open
MikuAuahDark opened this issue Mar 5, 2021 · 1 comment
Open

Method inheritance handling #4

MikuAuahDark opened this issue Mar 5, 2021 · 1 comment

Comments

@MikuAuahDark
Copy link
Owner

MikuAuahDark commented Mar 5, 2021

Since Teal currently doesn't support inheritance (teal-language/tl#97, teal-language/tl#200), how does this definition handle with inheritance?

  1. Only define the function methods in its class they're designated. This means Object:release() is only declared at Object record and not anywhere else for example. Thus requires user to cast at many places.
  2. Define the parent function methods in the derived class too. This means Object:release() also declared at ByteData record for example.

Currently this definition does point 1, but I'd like to hear others opinion about this.

CC @pdesaulniers

@MikuAuahDark MikuAuahDark changed the title Inheritance? Method inheritance handling Mar 5, 2021
@pdesaulniers
Copy link
Contributor

I'm not sure. I think approach 2 would be more ergonomic for the time being. However, approach 1 might be more future-proof, assuming that Teal will support some form of sub-typing at some point...

I believe @hishamhm was considering adding abstract interfaces to Teal? I think interfaces would work well for the Object example above.

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

No branches or pull requests

2 participants