Skip to content

RFC: Unique syntax for metatable types #70

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ffrostfall
Copy link
Contributor

@ffrostfall ffrostfall marked this pull request as ready for review November 7, 2024 03:57
@aatxe aatxe self-assigned this Dec 3, 2024
@Wunder-Wulfe
Copy link

I believe this would be very helpful for manually defining classes without using this structure:

type Class = setmetatable<
    {
       KeyType: ValueType;
    },
    classMeta
>;

Though, the way metatables are currently presented to the user in the type engine is with @metatable, so it may be more convenient to copy that syntax as well:
image

type Class = {
    KeyType: ValueType;
    @metatable classMeta;
}

@aatxe
Copy link
Contributor

aatxe commented Feb 24, 2025

The main concern about @metatable would be conflicting with possible additions for attributes on types. If we pick some specific syntax for writing metatables, we would change the way it is displayed to match that.

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

Successfully merging this pull request may close these issues.

3 participants