Specialization

The interpreter can be specialized for a given input expression, which has the effect of compiling that expression.


> (topinterp '(+ (* 3 4) 5))
17

> (specialize 'topinterp
             '('(+ (* a b) c))
             'expr1 '(a b c))

> (pp expr1)

(LAMBDA-BLOCK EXPR1 (A B C)
  (PROGN
    (PUSH A *STACK*)
    (PUSH B *STACK*)
    (TIMES)
    (PUSH C *STACK*)
    (PLUS)
    (POP *STACK*)))

> (expr1 3 4 5)
17

Contents    Page-10    Prev    Next    Page+10    Index