Advertisement
wandrake

Test Mylang

Apr 14th, 2011
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.56 KB | None | 0 0
  1. let r0 = Listenv.emptyenv(Int(0));;
  2.  
  3. let test1 = Sum(Eint(5), Eint(2));;
  4. let nameparam =
  5. Let(
  6.     "x",
  7.     Fun(
  8.         "a",
  9.         Sum(Nameden "a", Nameden "a")
  10.     ),
  11.     Let(
  12.         "q",
  13.         Eint(2),
  14.         Apply(
  15.             Den "x",
  16.             Name(Sum(Den "q", Den "q"))
  17.         )
  18.     )
  19. );;
  20.  
  21. let wrongnameparam =
  22. Let(
  23.     "x",
  24.     Fun(
  25.         "a",
  26.         Sum(Nameden "a", Nameden "a")
  27.     ),
  28.     Let(
  29.         "q",
  30.         Eint 2,
  31.         Apply(
  32.             Den "x",
  33.             Sum(Den "q", Den "q")
  34.         )
  35.     )
  36. );;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement