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

Implement statements-as-expressions #17

Open
WillBAnders opened this issue May 18, 2023 · 0 comments
Open

Implement statements-as-expressions #17

WillBAnders opened this issue May 18, 2023 · 0 comments

Comments

@WillBAnders
Copy link
Contributor

Statements-as-expressions allows some statements (like if/match) to be used as expressions that return a value. This could easily be done by simply converting these to expressions and using Statement.Expression, however that requires hardcoding a list of allowed expressions. There are two open questions related to this:

  • Figure out an effective way to distinguish which Ast/Ir classes are usable as statements/expressions without having to hardcode a list. This has been tried previously with interfaces, which seems manageable but is a little messy with Kotlin.
  • Figure out if/how wrapped classes (like Statement.Expression) can be removed. The current belief is that some wrapped classes like Statement.Component may be necessary for the Analyzer to handle validation; if so there may not be a compelling reason to redesign things here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant