-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Provisionally add let/var...else to the design overview
#1388
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
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.
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.
Can you help me understand the motivation for documenting this prior to formally proposing/adopting it? Unlike the initial stuff in #83 or your more recent design doc updates, this doesn't seem like it will help bootstrap the language design or provide important context, and unlike the discussion of
constin #1378, I don't think this is something people will be asking about if we don't address it.Uh oh!
There was an error while loading. Please reload this page.
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.
It actually came up because I was trying to figure out what belonged in "refutable patterns" versus "
matchcontrol flow statement" when working on the design overview. (Resolution: theifclause is part of thecasepart of amatch, not refutable patterns in general because they aren't as clearly useful forlet/var...else.) It seemed like there were any design questions left for this feature after the Discord discussion, so I thought I'd just put a quick write up to show the direction we were thinking. I'm happy to follow this up with a real proposal, but I didn't expect that the leads would have the bandwidth to land one of those before the going-public talk, and I wanted to flesh out this design overview with as much of what we were thinking as I could before it got a lot of viewers.I do think it is helpful to start pinning this down for thinking about the pattern matching (and possibly error handling) design space.
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.
FWIW, I'm happy either way, no strong opinion.
I have lots of questions in this space, but I'm fine with the provisional writeup here. I don't think its going to cause deep misunderstandings even if we end up changing anything, or be off-putting for folks in any way absent a full rationale.
I wasn't part of the Discord discussion, I'd defer to @zygoloid and @KateGregory here.
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.
FWIW I'm not worried about misunderstandings, I'm worried about anchoring.
For example, I think there's at least one major design question that the Discord discussion doesn't really address, which is whether we should have this feature at all. There may be other combinations of pattern matching/error handling features which would make this one superfluous, but I think this being in the language design, even provisionally, will tend to steer us away from considering them.
I understand the desire to put as much of what we're thinking as possible in front of people when we go public, but I don't think this is the right venue for that.
docs/designshould be the current actual design of Carbon, as determined by the evolution process, not our informal thoughts about where the evolution process will go in the future.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.
@josh11b created an issue to create a proposal out of this: #1758
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.
@geoffromer: Writing a propsal here: #1871 (WIP).