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

Value classes #14

Open
AskingQuestions opened this issue Dec 17, 2018 · 0 comments
Open

Value classes #14

AskingQuestions opened this issue Dec 17, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@AskingQuestions
Copy link
Contributor

value class Vector3 {
    float x = 0; // Primitive properties are copied
    float y = 0;
    float z = 0;

    void @construct(float x, float y, float z) {
        ...
    }
}

// Usage

let vec = new Vector3(1, 2, 3) // Put on the stack for supported languages
vec.x = 321; // Illegal

someFunc(vec); // Passed by value for supported languages

This might be implemented along with #13

@AskingQuestions AskingQuestions self-assigned this Dec 17, 2018
@AskingQuestions AskingQuestions added the enhancement New feature or request label Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant