-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Remove list types and list initialization syntax #2235
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instead of lists as before
cmnrd
added
enhancement
Enhancement of existing feature
language
Related to the syntax and semantics of LF
labels
Mar 7, 2024
lhstrh
approved these changes
Mar 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! It sure has simplified a few things.
cmnrd
commented
Mar 11, 2024
cmnrd
force-pushed
the
remove-list-initialization
branch
from
March 11, 2024 12:20
2115aa2
to
0b767c4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements another major step towards completing #1492. In addition to the built-in type
time
, LF would handle fixed-sized and dynamically sized lists/arrays specially. This required additional logic in our "type system" as well as dedicated syntax for initializing such list types. For instance, it was possible to write the following (in the C target):We also implemented this syntax for other targets, but it never worked all that well and it clashed with principles of the other target languages. Therefore, we decided in #1492 to drop this style of initialization. In addition, #1580 deprecated the
(...)
initializer syntax in favor of target language expressions. So in C, we can write now:This PR follows up and removes the deprecated syntax and performs additional cleanup. Concretely, it makes the following changes:
time[]
is removed. However, this can be easily replaced with the target time type, e.g., in C:state foo: interval_t[] = { 1ms, 2ms, 3ms}
.[i32, 4]
.Fixes #1675
Fixes #2056
Fixes #2202