Using `with` as the Elixir replacement for `let` in Lisp

I think it really just comes down to idioms. I know let from haskell/clojure (not that I use any of those languages extensively or even at all beyond toy stuff) but not having it in Elixir, which I at least read every day, has not ever not even once ever been any kind of problem. Can you give an example of where it would prevent a bug? Otherwise, using with denotes some kind of side-effect or procedure is about to take place which is a nice readability (really scannability) hint. Overloading it for variable scoping muddies this.

5 Likes