I don't like to write patterns with separate let expressions anymore. Together, they can be checked to be correct, but the syntax makes more bad code possible than if it wasn't available. I'm thinking of a new syntax, inspired by Elixir:
let last(list) := case list do
[val] => val
[_|tail] => last(tail)
I'm thinking of implementing this to replace the repeated let expressions for a single function.
This is now implemented. I changed my mind on the let expressions. Everyone can write bad code with any syntax. I need something else to promote good code.
I don't like to write patterns with separate
let
expressions anymore. Together, they can be checked to be correct, but the syntax makes more bad code possible than if it wasn't available. I'm thinking of a new syntax, inspired by Elixir:I'm thinking of implementing this to replace the repeated
let
expressions for a single function.