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

Remove : in variable declarations #503

Merged
merged 4 commits into from
May 17, 2021
Merged

Remove : in variable declarations #503

merged 4 commits into from
May 17, 2021

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Apr 28, 2021

Starting to apply #339

@jonmeow jonmeow requested a review from zygoloid April 28, 2021 20:57
@jonmeow jonmeow requested review from a team as code owners April 28, 2021 20:57
@google-cla google-cla bot added the cla: yes PR meets CLA requirements according to bot. label Apr 28, 2021
inference. Languages which use the syntax `<identifier>: <type>` typically allow
inference. Languages which use the syntax `<identifier> <type>` typically allow
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks to me like this one should not be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done (note, I plan to delete this file and instead have var discussion in the variables doc, since I think #339 supersedes it).

@@ -164,7 +164,7 @@ package ExampleUser;

import Geometry library("OneSide");

fn Foo(var Geometry.Shapes.Flat.Circle: circle) { ... }
fn Foo(Geometry.Shapes.Flat.Circle circle) { ... }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we intended to support the presence of var here (to distinguish a constant parameter from a parameter variable that can be mutated in the function body), but I don't see anything in the current design documents that describes what it would mean, so I think I'm happy with removing the var for now. We can add back some examples once we have a description of what this syntax would mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW I'm pretty sure I added this when doing code & name organization, and the meaning of var that you imply was definitely not what I intended -- this is just a typo.

docs/design/syntactic_conventions.md Outdated Show resolved Hide resolved
@jonmeow jonmeow merged commit 3149198 into carbon-language:trunk May 17, 2021
@jonmeow jonmeow deleted the var-update branch May 17, 2021 22:24
chandlerc pushed a commit that referenced this pull request Jun 28, 2022
Starting to apply #339

Co-authored-by: Richard Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes PR meets CLA requirements according to bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants