Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Anonymous-recursion/Racket/anonymous-recursion-3.rkt
Normal file
14
Task/Anonymous-recursion/Racket/anonymous-recursion-3.rkt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#lang racket
|
||||
;; We use Z combinator (applicative order fixed-point operator)
|
||||
(define Z
|
||||
(λ (f)
|
||||
((λ (x) (f (λ (g) ((x x) g))))
|
||||
(λ (x) (f (λ (g) ((x x) g)))))))
|
||||
|
||||
(define fibonacci
|
||||
(Z (λ (fibo)
|
||||
(λ (n)
|
||||
(if (<= n 2)
|
||||
1
|
||||
(+ (fibo (- n 1))
|
||||
(fibo (- n 2))))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue