Choice of -> over => #1520
Replies: 5 comments 12 replies
-
C++ uses |
Beta Was this translation helpful? Give feedback.
-
Or, to make return type annotations consistent with other type annotations,
Two existing successful successor languages, TypeScript and Kotlin, use this syntax. |
Beta Was this translation helpful? Give feedback.
-
I suggest use |
Beta Was this translation helpful? Give feedback.
-
So far, we haven't had any reports of confusion (or parse ambiguity) between the two meanings of |
Beta Was this translation helpful? Give feedback.
-
IMHO, to be consistent with the syntax when define a type in declare variable, the good syntax is In the ReadMe:
So, don't do the same errors also for the syntax. |
Beta Was this translation helpful? Give feedback.
-
As someone who is primarily codes not in C++ but in PHP and the JS suites, what was the logic behind choosing to use the skinny arrow over thick arrow for function declarations?
fn main() -> i64 { ... }
Based on the Carbon docs for pointers:
Won't using
->
in both places cause confusion? Would using=>
be better for function declaration simply because people who have used other languages will more easily recognize it?Beta Was this translation helpful? Give feedback.
All reactions