next up previous contents index
Next: Computer Resources for A++ Up: Imperative Programming in A++ Previous: The abstraction `while'   Contents   Start

A++ code of `while'


(define while
  (lambda(c body)
    (define loop
      (lambda()
        (if c
            ((lambda()
               (body)
               (loop)))
            false)))
    (loop)))
;
(define while-test
  (lambda(n)
    (while (gtp n zero)
      (lambda()
        (define n (pred n))
        (ndisp! n)))))



Georg P. Loczewski 2004-03-05


Impressum und Datenschutz