Mapcar-lambda is easy. Here, watch:
Mapcar: Do <something> to every item in a list.
Lambda: Same as defun but no `name' ...A Lambda is list of process' just like the formal (named) procedure defun.
Demonstrations:
I will demonstrate the process of printing each string item in a list.
;; if the list is `empty' or `nil'
nil
;; return `nil'
;; otherwise
;; print the first item in the list
;; strip off the first item (because we just printed it) and send the rest of the list back through this function again.
)
)
)
(print-it '("one" "two" "three" "four" "five" "six" "se7en"))
Lambda is even easier to unerstand. Since it is nothing more then a formal procedure without a name it can be defined on the fly (so to speak) or at the point of use/need.
( (lambda () (1+ 2)) )
Will return what? ...3. Good.
So, a Mapcar-Lambda construct is saying nothing more then: "Preform <this> function on each and every item in a list."
How's that? Is the process a bit more clear?
Extra Credit:
using the print-it function above we can build our own version of mapcar.
Here is a redefinition of mapcar.
(map princ '("one" "two" "three" "four" "five" "six" "se7en"))