|
|
|
|
|
by gethly
171 days ago
|
|
> Also think about returning lambda's. Should it look like this?
>
> fn foo(n i32) (i32 i32) {} It should be fn foo(n i32, m i32) (i32, i32) {}
It will also allow future implementation of named returns, like in Go: fn foo(n i32) (a i32, b i32) {}
As for semicolon, that is needed only if you have inline expression: for (;;;) {}
Or inline block, like in Go: if foo := a + b; foo > c {}
|
|
Even if you your context-depended parser can recognize it, does the user? I agree that a language designer should minimize the amount of muscle damage, but he shouldn't forget that readability is perhaps even more critical.
____
1. Note, even if the parser can recognize this, for humans the '>' is confusing unless syntax highlighting takes care of it. One time it delimits a generic type argument, the other time it is part of '->'. This is also an argument for rendering these things as ligatures.