News for hackers. Stuff that matters.
Re:Lisp is not functional (2010) by orthecreedence on Wednesday February 08, 2017 @01:53PM (#13600920)
> In fact it can be argued that lisp is one of the least functional languages ever created

Come on. Returning a value from an (if ...) already makes it more functional than a lot of languages. Sure, it's not functional in the sense Haskell is functional, but you could certainly write all your code in a functional manner using it, abstracting out any side effects via macros. I would say it's fairly well-geared towards functional programming if one was determined to use it for such a thing.

That said, I wouldn't call lisp a "functional" language. I'd call it multi-purpose. It CAN be functional, it CAN be imperative, it CAN be object-oriented.

It's certainly not the least functional language ever created though.

Re:Lisp is not functional (2010) by reikonomusha on Wednesday February 08, 2017 @02:14PM (#13601097)
The author very clearly defined what he means by functional, and he is correct, idiomatic Lisp is not. IF being a value-returning expression only encourages functional programming in the author's sense, since functions with conditionals can be written without explicit control flow where you can sneak side effects in. But, to be clear, flow control doesn't affect functional purity, and so it can be said that IF expressions vs. statements don't actually provide more or less functional behavior.

With side effects rife within Lisp's standard library, and with things like dynamic variables included with the language, I have a difficult time believing that it would be easy to "abstract out" side effects with some macros, while simultaneously providing a convenient, broad set of capabilities to program with. At that point, you might as well use macros to compile a whole new DSL within Lisp.

Re:Lisp is not functional (2010) by eikenberry on Wednesday February 08, 2017 @02:25PM (#13601208)
Defining an already used word to mean something precise and then arguing based on that is fine when constrained to a subset of technical readers who are used to this idea (you see this a lot in philosophy papers), but when publishing to a general readership you can't expect people to just accept that.
Re:Lisp is not functional (2010) by reikonomusha on Wednesday February 08, 2017 @02:31PM (#13601260)
I would agree with you if the author did not explicitly say what he meant, and assumed the reader knew what he meant, but the author did not make any such assumption.

In order to quell the issue of "functional" having many definitions, the author chose one, and wrote about it. I don't see your alternative, which seems to be "accept that functional means something different and write about that", as one that is worthwhile to pursue.

Re:Lisp is not functional (2010) by harry8 on Wednesday February 08, 2017 @06:04PM (#13603056)
Maybe to acknowledge that "functional" is used with a different meaning, often, would be sensible rather than just pretending all one needs to do is re-define it from common usage and proceed.

People are not compilers. If you want to redefine a word that is already in your readers' vocabulary with a meaning ascribed you've kind of got to talk about why you're doing that and why your redefinition is worthwhile and the alternative, generally accepted meaning needs to be jettisoned. Or you risk unintentional impersonation of a crank, which would be a shame if you're actually correct.

Re:Lisp is not functional (2010) by pyrale on Thursday February 09, 2017 @02:32AM (#13605316)
The point here is that the definition in the article is not something new. The author merely chooses to pick an accepted definition of functions, and build from there.

You makd it look like he's trying to push a new definition, which is not true.

Re:Lisp is not functional (2010) by AnimalMuppet on Wednesday February 08, 2017 @03:14PM (#13601600)
> The author very clearly defined what he means by functional, and he is correct, idiomatic Lisp is not.

But if the definition is the author's own special definition, the conclusion may be true and still be completely uninteresting. The standard definition is the standard one for a reason - it turns out to be useful for having meaningful conversations about the issue.

But even if you accept the author's definition, then you run into:

> In fact it can be argued that lisp is one of the least functional languages ever created

For that to be true, "one of the least functional languages ever created" must be a really large set. That set must include, say, 95% of all languages ever created - which makes the claim not a very meaningful statement.

Re:Lisp is not functional (2010) by pron on Wednesday February 08, 2017 @03:12PM (#13601582)
If you think the author's definition is clear and precise, then Haskell definitely doesn't qualify as functional by that definition, either. E.g., Haskell only encourages writing functions (i.e. total functions), so by that definition it also just encourages functional programming. See my other comment: https://news.ycombinator.com/item?id=13601299
Re:Lisp is not functional (2010) by Grue3 on Wednesday February 08, 2017 @04:33PM (#13602350)
>Returning a value from an (if ...) already makes it more functional than a lot of languages

Like which? Pretty much every language has a ternary operator. Lisp's IF is not a function, by the way. A truly functional IF would have to wrap THEN and ELSE clause in lambdas so that all arguments can be evaluated before deciding which one of them to execute.

Re:Lisp is not functional (2010) by throwaway91111 on Wednesday February 08, 2017 @02:20PM (#13601152)
How would you describe functional? It seems that you're conflating it with SSA.
Re:Lisp is not functional (2010) by marssaxman on Wednesday February 08, 2017 @05:09PM (#13602662)
That's reasonable, because "SSA is functional programming", as demonstrated in Appel's classic paper:

http://www.cs.princeton.edu/~appel/papers/ssafun.pdf

Re:Lisp is not functional (2010) by throwaway91111 on Thursday February 09, 2017 @04:48PM (#13611324)
I guess you could view it that way.

I am more used to thinking of it in terms of having function values (closures), but I think you could argue the lexical scoping that leads to SSA is all that's necessary once you have closures.

In any case, the vast majority of the lisp code I've read has been imperative and non-functional.

Re:Lisp is not functional (2010) by throwaway91111 on Thursday February 09, 2017 @07:02PM (#13612191)
Of course, there's the problem of comparing clojure and cl in the same breath....