3 ms·
> The very fact that you must write (function sin), or #'sin, or use funcall is a way that it treats functions differently than normal values. It doesn't treat
by kbp 9y ago
> The very fact that you must write (function sin), or #'sin, or use funcall is a way that it treats functions differently than normal values.
It doesn't treat functions differently from other values. You can say (defvar fn (lambda (x) (+ x 2))) and put a function in a value cell if you want, and then to pass it to a function you just say fn, same as if it were a non-function value. The distinction you're talking about is about symbols being treated differently depending on context, not anything about functions being treated differently from other values.
- db48x 9y agoI'm perfectly well aware that the difference is only in how names are resolved into values, and not in the values themselves. This is a distinction that doesn't matter to most people. What they care most about is what they have to type to convince the compiler to do what they want, and when there are exceptional circumstances that make them think harder or remember more details.
- lispm 9y agoTelling explicitly what one wants to do actually helps the compiler and it helps with the maintenance. The compiler then can help me to find calls which are just accidents, name clashes, etc. In a Lisp-2 in the expression (sin 2) then SIN is always a function name. It can't be anything else. It's not possible to bind a name in the function namespace to a non-function (or macro). Using something like FUNCALL is a clear sign that a function value is being called. This makes the source code longer, but it helps me to understand the code even months/years later.
- db48x 9y agoPersonally I don't think the distinction between Lisp-1 and Lisp-2 is a very important one, in terms of practical engineering. I just wish I could use any Lisp more often; Lisp-1 vs Lisp-2 doesn't really enter in to it. Now, I have to go back to working on this Automake/Autoconf mess I'm working on. mumble mumble M4 mumble...
- deleted 9y ago[deleted]