I apologize if this has an obvious answer. I would like to find a lazy functional programming language where the following pseudo code makes sense:
let f = function(x) {
let y = x*x // The variables y and z
let z = y*2 // are local
return z
}
This is, of course, doable in a functional, declarative language like haskell. Either with let bindings or where keyword. These are just chained together in one expression.
--local variables with 'where'
--local variables with let
https://wiki.haskell.org/Let_vs._Where