Lecture overview -- Keyboard shortcut: 'u'  Previous page: Ad hoc currying in Scheme (1) -- Keyboard shortcut: 'p'  Next page: Web related higher-order functions [Section] -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home    Lecture 4 - Page 25 : 34
Functional Programming in Scheme
Higher-order Functions
Ad hoc currying in Scheme (2)

Better results:

Expression

Value

(define gmap (curry-generalized map))
(define li-mapper (gmap li))
(li-mapper (list "one" "two" "three"))
("<li>one</li>" 
 "<li>two</li>" 
 "<li>three</li>")
(gmap li (list "one" "two" "three"))
("<li>one</li>" 
 "<li>two</li>"
 "<li>three</li>")

Examples of curry generalization of map. Using curry-generalized it is possible to make a li-mapper in an elegant and satisfactory way. The last row in the table shows that gmap can be used instead of map. Thus, gmap can in all respect be a substitution for map, and we may chose to redefine the name map to the value of (curry-generalized map).