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

Special elements and properties #26

Open
AndreVanDelft opened this issue Jan 9, 2017 · 2 comments
Open

Special elements and properties #26

AndreVanDelft opened this issue Jan 9, 2017 · 2 comments

Comments

@AndreVanDelft
Copy link

Special elements ..., break and break? are useful to have, but they mess up axioms and properties.

E.g.

property("Commutativity of +" ) = forAll { (x: Language, y: Language) => x + y <-> y + x }

This does not hold for x or y being such a special element.

property("Associativity of *") = forAll { (x: Language, y: Language, z: Language) => (x * y) * z <-> x * (y * z) }

This should not hold if x, y or z is ....
Or maybe it should, and is the problem that we need an alternative for the parentheses (Call(...)?), as long as we are sticking to Scala syntax.
BTW x*y*z should be yet another thing.

@anatoliykmetyuk
Copy link
Owner

Related to #28. Indeed, we need a way to explicitly say where we want to place the parentheses. I am very reluctant to introduce custom parsers as we did in SubScript, since the learning curve increases and the attractiveness for the users decreases as a result.

@AndreVanDelft
Copy link
Author

We could propose to the Dotty team that their parse tree contains the parentheses, if it doesn't already do so. Then a macro could do the work for us, I think.

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

2 participants