You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GopherLua is a Lua5.1 implementation. You should be familiar with Lua programming language. Have you read Lua 5.1 reference manual carefully?
GopherLua is a Lua5.1 implementation. In Lua, to keep it simple, it is more important to remove functionalities rather than to add functionalities unlike other languages . If you are going to introduce some new cool functionalities into the GopherLua code base and the functionalities can be implemented by existing APIs, It should be implemented as a library.
Please answer the following before submitting your issue:
What version of GopherLua are you using? :
What version of Go are you using? :
What operating system and processor architecture are you using? :win
What did you do? : use metatable to compare table with number
What did you expect to see? :
What did you see instead? :
metatable func __lt and __le not work
localb=setmetatable({ _val=10 }, {
__le=function(n, m)
localx=type(n) =='table' andn._valorm._vallocalval=type(n) ~='table' andnormprint('__le:', x, val)
returnx<=valend,
__lt=function(n, m)
print('__lt:', n,m)
return1end,
})
and
print(b<1) -- it will report an error
but it can be run in lua5.1,see the pic bellow
The text was updated successfully, but these errors were encountered:
Please answer the following before submitting your issue:
metatable func __lt and __le not work
and
but it can be run in lua5.1,see the pic bellow
The text was updated successfully, but these errors were encountered: