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

RFC: Allow multiple traits in one interface #31

Open
KlausC opened this issue Apr 15, 2020 · 3 comments
Open

RFC: Allow multiple traits in one interface #31

KlausC opened this issue Apr 15, 2020 · 3 comments

Comments

@KlausC
Copy link
Contributor

KlausC commented Apr 15, 2020

It should be possible to define interfaces, which require more than one interface type.
Example with proposal for syntax:

@trait ProblemDescription prefix Is,IsNot
@trait Solve
@implement Tuple{IsProblemDescription,CanSolve} by solve(_2, _1, general_parameters)
@KlausC KlausC changed the title Allow multiple traits in one interface RFC: Allow multiple traits in one interface Apr 15, 2020
@tk3369
Copy link
Owner

tk3369 commented Apr 17, 2020

Love this idea. The syntax shouldn't require Tuple{} construct though?

@implement IsProblemDescription,CanSolve by solve(_2, _1, general_parameters)

@KlausC
Copy link
Contributor Author

KlausC commented Apr 17, 2020

Agreed. Your syntax looks cleaner.
I was actually thinking of the key type of BinaryTraits.interface_map and the value type of traits_map. ( Tuple{A,B} isa Datatype). But that is independent of the user syntax.

@tk3369
Copy link
Owner

tk3369 commented Apr 20, 2020

This feature is a generalization of what was proposed from #29

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

2 participants