4 ms·
> 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
by bitwize 6y ago
> 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.
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.
- pfdietz 6y agoMuch easier, in the sense that you don't have to type #' to get from the function namespace to a value. Oh no, I had to type two characters. 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.
- dunefox 6y ago> you must first scoop them out of their special namespace So (mapcar #'f list) instead of (mapcar f list) ?