2014-01-05 20:05:08 +00:00
|
|
|
import Int.
|
|
|
|
variables x y z : Int
|
2013-11-14 23:15:04 +00:00
|
|
|
|
2014-01-05 18:32:47 +00:00
|
|
|
(*
|
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)
|
2014-01-05 18:32:47 +00:00
|
|
|
*)
|
2013-11-14 23:15:04 +00:00
|
|
|
|
2014-01-05 20:05:08 +00:00
|
|
|
eval sum + 3
|