-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Values, variables, pointers, and references #2006
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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.
Thanks for all the feedback, and sorry for delay getting a new revision -- I think I've addressed all of this feedback. I've resolved the threads that were really clearly addressed and responded to the rest. PTAL!
Co-authored-by: Geoff Romer <[email protected]>
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.
Awesome! Looks good to merge.
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.
Merging, many thanks to the so many folks who helped with this one. =D
Also indicate what can appear within parentheses. This is intended to be a clarification, not a design change. Note that while we previously described the operand of `++` or `--` as being simply an expression, the operand can never be anything other than the kinds of expression the diagram now shows due to the expression category rules added in carbon-language#2006. Fixes carbon-language#3079.
Also indicate what can appear within parentheses. This is intended to be a clarification, not a design change. Note that while we previously described the operand of `++` or `--` as being simply an expression, the operand can never be anything other than the kinds of expression the diagram now shows due to the expression category rules added in carbon-language#2006. Fixes carbon-language#3079.
…am. (#3083) Also indicate what can appear within parentheses. This is intended to be a clarification, not a design change. Note that while we previously described the operand of `++` or `--` as being simply an expression, the operand can never be anything other than the kinds of expression the diagram now shows due to the expression category rules added in #2006. Fixes #3079.
This implements initializing expression semantics for structs and tuples, following #2006 and discussions since. Tuple and (and analogously, struct) literals are treated as having a mixed expression category that is later resolved based on how the literal is used, as either a tuple initializer or a tuple value, at which point we create a `TupleInit` or `TupleValue` that represents the formation of the tuple initializer or tuple value from the tuple literal. There's quite a lot of TODOs here, and the SemIR representation is still not quite right, but this seems like a good place to checkpoint some incremental progress.
Introduce a concrete design for how Carbon values, objects, storage, variables,
and pointers will work. This includes fleshing out the design for:
how they interact, and terminology that anchors on their expression nature.
efficiently support function inputs.
seen on function boundaries in the calling convention.
const
type qualifier for use when the value expression category systemis too abstracted from the underlying objects in storage.