clearly nothing miraculous happening here.
procedures bit limited though on accepting variable number of
arguments , think relaxing this make exploratory
programming easier
;; continuation passing style
(defun integer-divide(a b success failure)
(if (= b 0)
(funcall failure "division by zero")
(multiple-value-bind (c d) (floor a b)
(funcall success c d))))
CL-USER> (integer-divide 10 3 #'list (lambda (x) x))
(3 1)
CL-USER> (integer-divide 10 2 #'list (lambda (x) x))
(5 0)
CL-USER> (integer-divide 10 1 #'list (lambda (x) x))
(10 0)
CL-USER> (integer-divide 10 4 #'list (lambda (x) x))
(2 2)
CL-USER> (integer-divide 10 0 #'list (lambda (x) x))
"division by zero"
CL-USER>