doc-src/Codegen/Thy/examples/lookup.ML
author wenzelm
Wed, 11 Apr 2012 11:44:21 +0200
changeset 47420 0dbe6c69eda2
parent 30226 2f4684e2ea95
permissions -rw-r--r--
just one dedicated execution per document version -- NB: non-monotonicity of cancel always requires fresh update; explicit terminate_execution; tuned source structure;

structure ROOT = 
struct

structure Codegen = 
struct

fun lookup ((k, v) :: xs) l =
  (if ((k : string) = l) then SOME v else lookup xs l)
  | lookup [] l = NONE;

end; (*struct Codegen*)

end; (*struct ROOT*)