2014-01-01 21:52:25 +00:00
|
|
|
Import Int.
|
2013-11-14 23:15:04 +00:00
|
|
|
Variables x y z : Int
|
|
|
|
|
|
|
|
(**
|
2013-12-27 03:49:04 +00:00
|
|
|
import("util.lua")
|
2013-11-14 23:15:04 +00: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 19:51:38 +00:00
|
|
|
print(def, ":", env:type_check(def))
|
2013-11-14 23:15:04 +00:00
|
|
|
env:add_definition("sum", def)
|
|
|
|
**)
|
|
|
|
|
|
|
|
Eval sum + 3
|