(define greater-or-equal
(lambda (x)
(lambda (y)
((less-or-equal y) x)
)
)
)
(define reminder
(lambda (div)
(lambda (div_by)
((Y (lambda (f)
(lambda (x)
(((((greater-or-equal x) div_by)
(lambda (no_use)
(f ((subtract x) div_by))
))
(lambda (no_use)
x
)
)
zero)
)
))
div)
)
)
(display (church->int ((reminder (int->church 100)) (int->church 9))))
(newline)
(define divide
(lambda (div)
(lambda (div_by)
((Y (lambda (f)
(lambda (x)
(((((greater-or-equal x) div_by)
(lambda (no_use)
(succ (f ((subtract x) div_by)))
))
(lambda (no_use)
zero
)
)
zero)
)
))
div)
)
)
)
(display "50/8=")
(display (church->int ((divide (int->church 50)) (int->church 8))))
(newline)