doc-src/Tutorial/CodeGen/exec
author berghofe
Fri, 16 Jul 1999 12:14:04 +0200
changeset 7015 85be09eb136c
parent 5377 efb799c5ed3c
permissions -rw-r--r--
- Datatype package now also supports arbitrarily branching datatypes (using function types). - Added new simplification procedure for proving distinctness of constructors. - dtK is now a reference.

consts exec :: ('a => 'v) => 'v list => (('a,'v) instr) list => 'v list
primrec
"exec s vs [] = vs"
"exec s vs (i#is) = (case i of
    Const v  => exec s (v#vs) is
  | Load a   => exec s ((s a)#vs) is
  | Apply f  => exec s ( (f (hd vs) (hd(tl vs)))#(tl(tl vs)) ) is)"