by pfdietz · 6y ago · 0 comments
When I ask to have the advantage of a Lisp-1 explained to me, I get some handwaving about "elegance", rather than a specific explanation for why someone would want that. Personally, I find a Lisp-2 (or a Lisp-N) to be more convenient and more understandable. And I don't have to have lexical variables named "lst".
Ruby, PERL, R, Shell languages, Elixir.
The closest parallel I can think of is Scala implicits. You give me a fragment of Scala code using implicits it might be hard to know _what_ is going to happen. Similarly, having a bunch of namespaces (or, perhaps more importantly, leaning into them and having many name overlaps) just means that it's harder to read a single code fragment and know what it's going to do.
Though I'm pretty partial to the argument that, like..... yeah you're going to call a function so the name refers to a function. But without extra symbols around this concept to help the reader, in this age it seems like a concept that is hard to take advantage of.
(here ...
versus (... here ...
That's what makes possible the two spaces.It encourages programming more in a functional style. It's much easier to implement and use higher order functions, if functions are treated like any other object. In Common Lisp, functions defined with DEFUN are not, by default. Common Lisp supports the functional style, but in order to operate on functions with higher-order functions, you must first scoop them out of their special namespace with FUNCTION; and if you want to apply a function you have as a value you must FUNCALL it.
Lisp-1s remove these extra steps, and to some programmers that is more understandable.
As for going in the other direction: I examined the Quicklisp source for how often funcall occurs: on about 0.4% of lines.
I will claim that adding these makes the code more understandable, not less.
So
(mapcar #'f list)
instead of
(mapcar f list)
?