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

Introduce a structure for lambda parameters #624

Closed
konnov opened this issue Feb 14, 2023 · 0 comments · Fixed by #689
Closed

Introduce a structure for lambda parameters #624

konnov opened this issue Feb 14, 2023 · 0 comments · Fixed by #689
Assignees

Comments

@konnov
Copy link
Contributor

konnov commented Feb 14, 2023

Currently, lambda definitions have their parameters as strings:

quint/quint/src/quintIr.ts

Lines 121 to 130 in 7c29089

export interface QuintLambda extends WithId {
/** Expressions kind ('lambda' -- operator abstraction) */
kind: 'lambda',
/** Identifiers for the formal parameters */
params: string[],
/** The qualifier for the defined operator */
qualifier: OpQualifier,
/** The definition body */
expr: QuintEx,
}

Since the operator definitions are represented with lambdas, there is no good way to refer exactly to the place where the parameter has been defined (except for giving the definition's name and the parameter name). As we discussed with @bugarela and @shonfeder, it would be good to introduce a structure for parameters, e.g.:

export interface QuintParamDef extends WithId {
  /** Expressions kind ('param' -- an operator parameter) */
  kind: 'param',
  /** The parameter name */
  name: string,
}

This would enable easier goto definition and simplify code in REPL.

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

Successfully merging a pull request may close this issue.

3 participants