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

Trait documentation wrong #26

Open
xenoterracide opened this issue Oct 5, 2021 · 0 comments
Open

Trait documentation wrong #26

xenoterracide opened this issue Oct 5, 2021 · 0 comments

Comments

@xenoterracide
Copy link

I saw this

Traits provide a mixin composition mechanism that is missing in Java. Similar to interfaces in Java, traits are used to define object types by specifying the signature of the supported methods. Unlike interfaces, traits can be partially implemented; i.e. it is possible to define implementations for some methods.

Obviously this is not true as of Java 8, which is 7 years old now. Also the official definition of a Trait https://en.wikipedia.org/wiki/Trait_(computer_programming)

while a trait defines behaviors via full method definitions: i.e., it includes the body of the methods. In contrast, mixins include full method definitions and may also carry state through member variable, while traits usually don't.

It looks like you have a mixin as it can have member variables. Of course language in the programming world has often propagated Trait's and Mixin's as synonyms. So it's not a big deal.

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

1 participant