mapcar is a function that calls its first argument with each element of its second argument, in turn. The second argument must be a sequence. The ' map ' part of the name comes from the mathematical phrase, “mapping over a domain”, meaning to apply a function to each of the elements in a domain.
In Common Lisp apply is a function that applies a function to a list of arguments (note here that "+" is a variadic function that takes any number of arguments): (apply #'+ (list 1 2)) Similarly in Scheme: (apply + (list 1 2))
Description: funcall applies function to args. If function is a symbol, it is coerced to a function as if by finding its functional value in the global environment. Examples: (funcall #'+ 1 2 3) => 6 (funcall 'car '(1 2 3)) => 1 (funcall 'position 1 '(1 2 3 2 1) :start 1) => 4 (cons 1 2) => (1 .
(defun describe-paths (location edges)
(apply #'append (mapcar #'describe-path (cdr (assoc location edges)))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With