doc-src/Codegen/Thy/examples/lookup.ML
author wenzelm
Thu, 09 Sep 2010 20:09:13 +0200
changeset 39240 a0c0698e56c0
parent 30226 2f4684e2ea95
permissions -rw-r--r--
ML_Compiler.eval: reported positions need to contain offset, to avoid displaced reports due to synthesized line numbers;

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*)