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

Setters #147

Open
liquidev opened this issue Feb 4, 2023 · 0 comments
Open

Setters #147

liquidev opened this issue Feb 4, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers language feature

Comments

@liquidev
Copy link
Member

liquidev commented Feb 4, 2023

Just like it's possible to define getters, it should be possible to define setters:

struct Cell impl
    func new(value) constructor =
        @value = value

    func value() = @value
    func value=(new) = @value = new
end

let cell = Cell.new(1)
cell.value = 2
@liquidev liquidev modified the milestone: 0.8.0 Feb 4, 2023
@liquidev liquidev added enhancement New feature or request language feature labels Feb 4, 2023
@liquidev liquidev added this to the 0.8.1 milestone Feb 4, 2023
@liquidev liquidev added the good first issue Good for newcomers label Feb 5, 2023
@liquidev liquidev removed this from the 0.8.1 milestone Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers language feature
Projects
None yet
Development

No branches or pull requests

1 participant