In LISP, lambda functions are anonymous and are only evaluated when they are discovered in the code. Lambda functions are important because there are times when the programmer may want to include a function in just one place, but the function may be complicated that he may not want to store it or name it. LISP has the lambda expression which is used to write the lambda function. The syntax of these functions take the following format:
(lambda (parameters) body)
Lambda functions should only be included where LISP expects to find a function. Also, as we have already said these functions cannot be evaluated.
These are functions that take functions as a return a function or/and an argument. Higher-order functions are widely used in functional programming. Like in filter, map, and filter, these functions offer a way of defining reusable functionality. There are several high-order functions in LISP that are passed functions for arguments. However, we consider the “funcall” and “apply” as the most fundamental.
Tail recursion is a type of recursion that is as efficient as a while loop. To make a tail recursion more effective, it is necessary to perform a tail call removal. The compiler will always optimize self-recursive tail calls unless directed otherwise. Tail calls in LISP are often automatically compiled as loops. These functions do not appear on the stack and can be extremely difficult to trace. You probably already know that a function call is self-recursive if it calls itself. On the other hand, a function can be a tail call if it is the calling function's last operation. A self-tail call function calls itself the final operation. A tail-recursive function is defined as self-tail calls.
Auxiliary Variables and Specifiers
Auxiliary variables are defined using the keyword &AUX but are seldomly used. These variables are usually processed from left to right after all other parameter specifiers have been executed. Most programmers prefer to use the LET variable or other local variables that are defined in the function body instead. These variables cannot be supplied by the user because they are not parameters.