PPT Slide
SOME Lisp Programming Techniques
1. “currying” -- use lambda expressions to create functions with fewer arguments
( mapcar # '(lambda ( y ) (+ x y ) ) L ) )
( incr 2 '( 4 1 3 ) ) returns ( 6 3 5 )
2. Use of auxiliary functions to make programs
more readable and sometimes more efficient.
3. “tail recursion” -- recursion where all the work
is done on the way down, returns just pass control
( defun tr-fact ( n ) ( f-aux n 1 ) )
( f-aux ( 1- n ) ( * n res ) ) ) )