mirror of
https://github.com/correl/sicp.git
synced 2024-11-23 11:09:57 +00:00
Exercise 1.41
This commit is contained in:
parent
ef7ca0372e
commit
013bbded12
1 changed files with 15 additions and 1 deletions
16
1-3.org
16
1-3.org
|
@ -577,7 +577,21 @@ layout: org
|
||||||
#+begin_src scheme
|
#+begin_src scheme
|
||||||
(((double (double double)) inc) 5)
|
(((double (double double)) inc) 5)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#+begin_src scheme :tangle yes
|
||||||
|
;; -------------------------------------------------------------------
|
||||||
|
;; Exercise 1.41
|
||||||
|
;; -------------------------------------------------------------------
|
||||||
|
|
||||||
|
(define (double f)
|
||||||
|
(lambda (x) (f (f x))))
|
||||||
|
|
||||||
|
(((double (double double)) inc) 5)
|
||||||
|
;Value: 21
|
||||||
|
|
||||||
|
#+end_src
|
||||||
** Exercise 1.42
|
** Exercise 1.42
|
||||||
Let f and g be two one-argument functions. The "composition" f
|
Let f and g be two one-argument functions. The "composition" f
|
||||||
after g is defined to be the function x |-> f(g(x)). Define a
|
after g is defined to be the function x |-> f(g(x)). Define a
|
||||||
|
|
Loading…
Reference in a new issue