let in ES6
A possible way of expressing Scheme let expressions, such as
(let ((x 3) (y 5)) (+ x y))
is to use ES6 default parameters:
((x = 3, y = 5) => x + y)()
It is possible to go one step further by defining an auxiliary let_
function as:
const let_ = f => f()
Which can then be used as in:
let_((x = 3, y = 5) => x + y))
Not the most idiomatic JS, though :-)