-
Notifications
You must be signed in to change notification settings - Fork 1
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
PHI 1 - Labeled Tuples #4
base: master
Are you sure you want to change the base?
Conversation
|
||
### Expression Syntax Errors | ||
|
||
+ A label must be followed by a valid expression and comma operator, not another label. For example, `.label1 .label2 e` produces an error. |
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.
see comments above on types
TODO: partially labeled values, where some of the arguments are in order: `(1, 2, .z 3) <= (.x Num, .y Num, .z Num)`. what about interleaving vs. requiring all the explicit labels at the end ala Python? | ||
TODO: what are the type synthesis and type analysis rules for the labeled tuple expressions --> | ||
### Punning | ||
Some languages, such as Reason, have record punning. This is where a record's labels can be implied when it is declared using variables. For example, `{x, y, z} => {x: x, y: y, z: z}` is true. Similar punning fuctionality could be implemented in Hazel. For example, if this punning was implemented `(x, y, z) => (x: x, y: y, z: z)` would hold true. However, this creates a question of if every tuple created with variables should be a labeled tuple. Given this additional complexity and added development costs, I believe that labeled tuple punning should be considered out of scope for labeled tuples. |
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.
give the ambiguous example: (y, x, z)
-- is this punned or ordered?
1-labeled-tuples/1-labeled-tuples.md
Outdated
`e.label` will be the new expression form. `e.label` expects `e` to synthesize to a labeled tuple type and `label` to match one of the labels within `e`. | ||
|
||
`e.label` will return the value that has the label `label`. | ||
#### Backspace |
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.
separate section on Action Semantics
1-labeled-tuples/1-labeled-tuples.md
Outdated
![Synthesis Rule for Projection](syn_1.png) | ||
|
||
#### Analysis | ||
![Analysis Rule Single](ana_1.png) |
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.
don't want to allow a type to be treated as a 1-tuple implicitly, so don't need this rule.
No description provided.