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

Replace some assert:s with (new) assume:s #30

Open
janvrany opened this issue Oct 10, 2023 · 1 comment
Open

Replace some assert:s with (new) assume:s #30

janvrany opened this issue Oct 10, 2023 · 1 comment

Comments

@janvrany
Copy link
Owner

assert:s at the beggining of methods should be replaced by assume:s, see an earlier discussion on slack:

There is assert:, and there is assume:. They are confusingly similar, just like vectors and differential forms are confusingly similar, in fact we are looking at the same mathematical phenomenon of contravariance. When I am in a function, say f(x), x>10, and I say assert(x+1 > 11), it is my (well, f's) responsibility to ensure that the assert typechecks.

But assume works "backwards", "demonic", "precondition", and "it's my caller's fault if not".

For time being, assume: can be implemented by means of assert:.

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