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

Remove annoying getters & setters #16

Closed
nmheim opened this issue Oct 13, 2021 · 1 comment
Closed

Remove annoying getters & setters #16

nmheim opened this issue Oct 13, 2021 · 1 comment

Comments

@nmheim
Copy link
Contributor

nmheim commented Oct 13, 2021

The getters and setters we currently use in the Ecosystem are only there because of the ⚥Sheep type which should demonstrate the forwarding of fields. We could get rid of all of them by overloading getproperty (and setproperty!) for ⚥Sheep instead:

function Base.getproperty(s::⚥Sheep, x::Symbol)
    if x == :sex || x == :sheep
        getfield(s,x)
    else
        getfield(s.sheep,x)
    end
end
@nmheim
Copy link
Contributor Author

nmheim commented Jun 13, 2022

closed in favour of #61

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

No branches or pull requests

1 participant