-
Notifications
You must be signed in to change notification settings - Fork 67
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
where {T} vs where T #53
Comments
What about foo(x::T) where T = 2x # confusing
foo(x::T) where {T} = 2x # clearer So a possible rule would be this:
|
The fewer special exceptions the better. For the sake of two characters, instead of having to remember (and code, maintain, etc) if long form and single type var, it's just "Always enclose in braces." |
Surveying Base Julia, the vast majority of even multiline function definitions with just a single name after the |
Added this in 8944eaa |
Following https://github.com/jrevels/YASGuide#other-syntax-guidelines, I propose that all occurrences of
where T
are replaced withwhere {T}
.This makes things clearer, and unifies the syntax with more complicated
where
statements (e.g., with multiple terms) which require{}
.Bad:
Good:
p.s. very cool. Thanks for working on this.
Edit: to make the point more explicit:
Also Bad:
Good:
The text was updated successfully, but these errors were encountered: