teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.15k stars 111 forks source link

Bug in tl.lua #483

Closed yuriv closed 3 years ago

yuriv commented 3 years ago

Hi,

You need to change 'load(...)' to 'loadstring(...)' int tl.lua:9443

Cheers

quienn commented 3 years ago

There's no bug. Since 5.2, load is the replacement for loadstring. You may want to look at https://github.com/teal-language/tl/blob/master/tl.lua#L1, where there's a little version checking logic going on that will apply some shims based on the version you're running the module.

hishamhm commented 3 years ago

@ghsttwn is correct: @yuriv, to use the module in Lua 5.1 you should install https://github.com/keplerproject/lua-compat-5.3. When installing the tl rockspec using LuaRocks, it installs compat53 as a dependency.