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

Rename core types for clarity #252

Merged
merged 2 commits into from
Apr 14, 2023
Merged

Rename core types for clarity #252

merged 2 commits into from
Apr 14, 2023

Conversation

grjte
Copy link
Contributor

@grjte grjte commented Apr 13, 2023

This PR addresses the following issues that have come up while working towards support for functions and evaluator functions:

  1. lack of distinction between a binding and accessing a binding (e.g. in a function declaration, we need to parse bindings, but in a function call we want to parse accesses of bindings)
  2. many structs are named in a format like _Type (e.g. VariableType), but actually they do not identify types in the language. Instead, they identify different expression variations for bindings (e.g. the value of a variable binding can be a single expression, a vector of expressions, a matrix of expressions, etc). This became confusing when implementing functions, as functions actually have types.

The first point is addressed by renaming Constant to ConstantBinding and Variable to VariableBinding.
The second point is addressed by replacing "Type" with "ValueExpr" (e.g. VariableType --> VariableValueExpr), although I'm open to other names. for this

grjte added 2 commits April 13, 2023 10:59
- rename Constant to ConstantBinding
- rename Variable to VariableBinding
- renamed VariableType, ConstantType, and ListFoldingValueType
@grjte grjte requested review from bobbinth, tohrnii and Fumuran April 13, 2023 10:12
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you!

Base automatically changed from grjte-refactor-clarity to next April 14, 2023 09:33
@grjte grjte merged commit b2d2cbf into next Apr 14, 2023
@grjte grjte deleted the grjte-refactor-clarity-2 branch April 14, 2023 09:34
@grjte grjte mentioned this pull request Apr 21, 2023
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 this pull request may close these issues.

2 participants