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

Using it variable after evaluation recomputes values #881

Closed
robdockins opened this issue Sep 8, 2020 · 0 comments · Fixed by #920
Closed

Using it variable after evaluation recomputes values #881

robdockins opened this issue Sep 8, 2020 · 0 comments · Fixed by #920
Assignees
Labels
command-line-repl Related to Cryptol's text-based UI UX Issues related to the user experience (e.g., improved error messages)
Milestone

Comments

@robdockins
Copy link
Contributor

Inside evalReplExpr, the it variable is defined so the result can be referred to later, if desired. However, it is simply bound to the parsed input expression, which means that the computation is just recomputed instead of reusing the result.

bindItVariable ty def1

We should use something like bindItVariableVal instead, and only fall back to binding the raw expression for types that cannot be translated back to expressions. Alternately, we should extend the dynamic environment data structure to accept values as well as expressions so translating back isn't necessary.

@robdockins robdockins added the UX Issues related to the user experience (e.g., improved error messages) label Sep 8, 2020
@yav yav added the command-line-repl Related to Cryptol's text-based UI label Sep 17, 2020
@robdockins robdockins self-assigned this Sep 22, 2020
@atomb atomb added this to the 2.10.0 milestone Sep 22, 2020
robdockins added a commit that referenced this issue Sep 30, 2020
so we can cache the value via it's thunk.  This prevents reevaluating
the term when the "it" variable is referenced later.

Fixes #881
robdockins added a commit that referenced this issue Sep 30, 2020
so we can cache the value via it's thunk.  This prevents reevaluating
the term when the "it" variable is referenced later.

Fixes #881
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-line-repl Related to Cryptol's text-based UI UX Issues related to the user experience (e.g., improved error messages)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants