-
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
Remove : in variable declarations #503
Conversation
docs/design/syntactic_conventions.md
Outdated
inference. Languages which use the syntax `<identifier>: <type>` typically allow | ||
inference. Languages which use the syntax `<identifier> <type>` typically allow |
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 looks to me like this one should not be changed.
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.
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) { ... } |
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.
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.
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 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.
Co-authored-by: Richard Smith <[email protected]>
Starting to apply #339 Co-authored-by: Richard Smith <[email protected]>
Starting to apply #339