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

Allow from without in, and remove suchthat keyword #202

Closed
julianhyde opened this issue Oct 4, 2023 · 0 comments
Closed

Allow from without in, and remove suchthat keyword #202

julianhyde opened this issue Oct 4, 2023 · 0 comments

Comments

@julianhyde
Copy link
Collaborator

julianhyde commented Oct 4, 2023

In #129 we added suchthat for constrained relations, for example

from (i, j) suchthat i >= 0 andalso i < j andalso j < 4;

Reading Relational Expressions for Data Transformation and Computation (Pratten, Mathieson, 2023), I realized that if we just allow variables to be declared in from without an in clause - and therefore range over their entire data type - then that is sufficient. The suchthat keyword becomes unnecessary; any suchthat clause can become a where clause. The above example becomes

from i, j where i >= 0 andalso i < j andalso j < 4;

If you prefer, you can also alternate scans (introducing new variables) with filters:

from i where i >= 0,
   j where i < j andalso j < 4;
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