Page:Scheme - An interpreter for extended lambda calculus.djvu/21

From Wikisource
Jump to navigation Jump to search
This page has been proofread, but needs to be validated.
Sussman and Steele December 22, 1975 20 Substitution Semantics and Styles

(DEFINE FACT
   (LAMBDA (N C)
       (== N 0
           (LAMBDA () (C 1))
           (LAMBDA ()
               (-- N 1
                   (LAMBDA (M)
                       (FACT M (LAMBDA (A) (** A N C)))))))))

We can see here that no functional application returns a value in a computation of factorial in this situation. We believe that functional usage, where applicable (pun intended), is more perspicuous than continuation-passing. We shall therefore use functional primitives such as * rather than ** wherever possible, keeping in mind that we could use ** instead if we wished.