News for hackers. Stuff that matters.
Re:Total Functional Programming [pdf] by eyelidlessness on Thursday October 06, 2016 @12:17AM (#12650216)
> For example, something as simple as assigning a variable has so much more meaning and functionality than I am used to, thanks to pattern matching.

Functional programming tends to take this even further, by eliminating variable assignment to some degree or another. Different languages approach this differently, for instance:

- Erlang (and I assume this extends to Elixir) asserts a variable's value, rather than assigning it. You can see how this works by attempting to assign another value to the same variable: it will throw an error.

- Clojure (and I assume most lisps?) bind a variable to a symbol, but that only applies to the code that follows; if you access a binding, then rebind it, the previous access will only reference the original value. (Clojure, being impure, has ways around this in a bunch of ways.)

There are no comments on this comment yet.