Open zygoloid opened 2 years ago
Food for thought, from Wren:
The nice thing about [Wren's] syntax as opposed to something like
=>
is that the end of the block has an explicit delimiter. That helps when chaining:numbers.map {|n| n * 2 }.where {|n| n < 100 }
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive
label. The long term
label can also be added for issues which are expected to take time.
This issue is labeled inactive
because the last activity was over 90 days ago.
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.