Design idea: terse function single-expression function body syntax #2131
Labels
design idea
An issue recording a specific language design idea that folks can potentially pick up.
long term
Issues expected to take over 90 days to resolve.
Early Carbon language design ideas included having a terser way of writing a function definition in the case where the body is a single expression. Instead of:
... we could allow something like ...
In such cases, an omitted return type would be treated as
-> auto
. Some other languages such as C# have similar functionality.Particular concerns that a proposal should consider:
=>
seems nice but might be too similar to->
. Also,=>
in acase
is followed by a block not an expression, creating some amount of inconsistency.The text was updated successfully, but these errors were encountered: