2014-01-05 12:05:08 -08:00
|
|
|
import Int.
|
|
|
|
variables x y z : Int
|
2013-11-14 15:15:04 -08:00
|
|
|
|
2014-01-05 10:32:47 -08:00
|
|
|
(*
|
2013-12-26 19:49:04 -08:00
|
|
|
import("util.lua")
|
2013-11-14 15:15:04 -08:00
|
|
|
local env = get_environment()
|
|
|
|
local plus = Const{"Int", "add"}
|
|
|
|
local x, y = Consts("x y")
|
|
|
|
local def = plus(plus(x, y), iVal(1000))
|
2013-12-22 11:51:38 -08:00
|
|
|
print(def, ":", env:type_check(def))
|
2013-11-14 15:15:04 -08:00
|
|
|
env:add_definition("sum", def)
|
2014-01-05 10:32:47 -08:00
|
|
|
*)
|
2013-11-14 15:15:04 -08:00
|
|
|
|
2014-01-05 12:05:08 -08:00
|
|
|
eval sum + 3
|