[<<][compsci][>>][..]
Sun Sep 13 10:39:18 CEST 2009

CPS vs. A-normal form

From [1]

  (print (* (+ x y) (- z w)))

in CPS, where `'k' is the contination of the expression:

  (+ x y (lambda (xy)
           (- z w (lambda (zw))
              (* xy zw (lambda (prod)
                         (print prod k))))))

in A-normal[2] form, which I've called ``nested let'' before:

  (let* ((xy (+ x y))
         (zw (- z w))
         (prod (* xy zw)))
    (print prod))


[1] http://www.ccs.neu.edu/home/shivers/citations.html#diss
[2] http://en.wikipedia.org/wiki/Administrative_normal_form



[Reply][About]
[<<][compsci][>>][..]