Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/First-class-functions/Scheme/first-class-functions.ss
Normal file
16
Task/First-class-functions/Scheme/first-class-functions.ss
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(define (compose f g) (lambda (x) (f (g x))))
|
||||
(define (cube x) (expt x 3))
|
||||
(define (cube-root x) (expt x (/ 1 3)))
|
||||
|
||||
(define function (list sin cos cube))
|
||||
(define inverse (list asin acos cube-root))
|
||||
|
||||
(define x 0.5)
|
||||
(define (go f g)
|
||||
(if (not (or (null? f)
|
||||
(null? g)))
|
||||
(begin (display ((compose (car f) (car g)) x))
|
||||
(newline)
|
||||
(go (cdr f) (cdr g)))))
|
||||
|
||||
(go function inverse)
|
||||
Loading…
Add table
Add a link
Reference in a new issue