Exercise 1.41. Define a procedure double that takes a procedure of one argument as argument and returns a procedure that applies the original procedure twice. For example, if inc is a procedure that adds 1 to its argument, then (double inc) should be a procedure that adds 2. What value is returned by

 
(((double (double double)) inc) 5)
 
(define (double f)
  (lambda (x)
    (f (f x))))
 
(((double (double double)) inc) 5)
 
exercise_1.41.txt · Last modified: 2009/03/02 00:38 by mariorz
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki