Skip to content

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Apr 14, 2025

Now that This is no longer a Var, it makes sense for Var to simply be a subinterface of LValueExpr. This improves clarity of the API.

Related to #281

Now that `This` is no longer a `Var`, it makes sense for `Var` to simply
be a subinterface of `LValueExpr`. This improves clarity of the API.
@Ladicek Ladicek added the 2.x Issue applies to Gizmo 2.x label Apr 14, 2025
@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 14, 2025

After this, I'd like to rename LValueExpr to Assignable, which will achieve what I attempted in #281 :-)

@dmlloyd
Copy link
Member

dmlloyd commented Apr 14, 2025

Since all assignable things are "variables" according to JLS (including array dereferences 🤯), what if we merged LValueExpr/Assignable and Var into one interface and call it Var? Actually, that's not a good idea because the array deref doesn't have a "name".

@dmlloyd dmlloyd merged commit f1a41d5 into quarkusio:main Apr 14, 2025
2 checks passed
@Ladicek Ladicek deleted the make-var-an-lvaluexpr branch April 15, 2025 06:39
@Ladicek
Copy link
Contributor Author

Ladicek commented Apr 15, 2025

Yeah agree, I think array element (Expr.elem()) is the prime example of an LValueExpr that is not a Var. I'm not sure if there are more, possibly not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issue applies to Gizmo 2.x
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants