2014-01-01 21:52:25 +00:00
|
|
|
Import Int.
|
2013-11-10 18:12:43 +00:00
|
|
|
Variable x : Int
|
|
|
|
|
2013-11-13 00:05:46 +00:00
|
|
|
(**
|
2013-11-10 18:12:43 +00:00
|
|
|
-- Add a variable to the environment using Lua
|
|
|
|
-- The type of the new variable is equal to the type
|
|
|
|
-- of x
|
2013-11-13 21:58:51 +00:00
|
|
|
local env = get_environment()
|
2013-12-22 19:51:38 +00:00
|
|
|
typeofx = env:type_check(Const("x"))
|
2013-11-10 18:12:43 +00:00
|
|
|
print("type of x is " .. tostring(typeofx))
|
2013-11-13 21:58:51 +00:00
|
|
|
env:add_var("y", typeofx)
|
2013-11-13 00:05:46 +00:00
|
|
|
**)
|
2013-11-10 18:12:43 +00:00
|
|
|
|
|
|
|
Check x + y
|