5 ms·
It's not a question of cool or not; it just seems you haven't been exposed to functional programming yet. Here's an introduction if you've got an imperative/OO
by dpapathanasiou 19y ago
It's not a question of cool or not; it just seems you haven't been exposed to functional programming yet.
Here's an introduction if you've got an imperative/OO background: http://www.defmacro.org/ramblings/fp.html http://www.defmacro.org/ramblings/fp.html
- Tichy 19y agoI thought LISP is functional, and it lets you change variables. So I don't think that is specific to functional programming.
- paulgb 19y agoLisp is not purely functional (few languages are). Purely functional languages do not let you modify variables. Edit: Also, programmers in non-pure functional languages will often still minimize their use of mutation (changing variables) for a number of reasons.
- Tichy 19y agoIn any case, when evaluating Erlang, I found the immutable variables to be rather unpractical. I can see why they might help to avoid errors with multi threading, but I don't see a reason to be excited about it? At the end of the day, it is another limitation of the language. With Java, that is what people complain about, the constraints, why wish for it in other languages? If you think that immutable variables reduce programming errors, you are free to just not change your variables anyway, I guess. No language constraint required.
- dpapathanasiou 19y agoAs paulgb said, Lisp is not purely functional, unlike Erlang or Haskell. And actually, you could ignore functional programming and write code in an imperative style in Lisp (though it's not recommended, since you'd be missing out on the benefits of using Lisp). Take a look at "Imperative Outside In" (chapter 3, section 2) in "On Lisp" (http://lib.store.yahoo.net/lib/paulgraham/onlisp.pdf http://lib.store.yahoo.net/lib/paulgraham/onlisp.pdf) for an example.