Open
Description
Do things the Python way:
Instead of
fn foo(a: int, b: int) -> int
// do some stuff
Do
fn foo(a: int, b: int) -> int:
// do some stuff
This applies to block level constructs:
if cond:
do:
// some stuff
else:
// other stuff
I think that the :
ultimately provides more readability and appearance of structure. Now the symmetry is that :
is used before a block but =>
is used to represent that code inline.
This does mean we have to be careful of :
in expressions. However, as with Python, I don't think it will come up much.