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

Make blocks legal expressions evaluating to arrays #352

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Conversation

frostburn
Copy link
Member

ref #351

@frostburn frostburn requested a review from inthar-raven June 17, 2024 18:14
@frostburn
Copy link
Member Author

@inthar-raven Assigning you as the reviewer based on your reaction on Discord.

I would be inclined to change record syntax to #[fif: 3/2] now too to make containers more alike, but I'd like to hear your overall opinion of this feature first.

This is mostly for conceptual consistency with blocks unrolling their contents onto the parent block which makes them look like arrays in a way. Unfortunately I couldn't find any practical uses for this feature in the prelude.

@frostburn frostburn linked an issue Jun 17, 2024 that may be closed by this pull request
Copy link
Contributor

@inthar-raven inthar-raven left a comment

Choose a reason for hiding this comment

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

Ideally, I like block expressions that evaluate to any type. (I don't know if that requires a stronger type system.) I think this is a good start for that.

@inthar-raven inthar-raven requested review from inthar-raven and removed request for inthar-raven June 17, 2024 22:27
@frostburn
Copy link
Member Author

Ideally, I like block expressions that evaluate to any type. (I don't know if that requires a stronger type system.) I think this is a good start for that.

I can make return statements legal to achieve that.

@frostburn
Copy link
Member Author

No reaction to tweaking the record syntax further. I'm pretty sure we're adding sets as containers so maybe #[1,2,2] would be syntax for the set {2, 1} later on. (Just to say that both #{} and #[] are going to be used so it doesn't matter which of them is the record from a grammar design perspective.)

@frostburn frostburn merged commit 8e3b2b0 into main Jun 18, 2024
1 check passed
@frostburn frostburn deleted the block-expressions branch June 18, 2024 07:56
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.

Make blocks legal right-hand sides for assignment
2 participants