lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm trying to do machine translation from an extremely
"loose" language to Lua. What I mean by "loose" is
that this language doesn't even have run-time typing.
You can compare strings and numbers and it converts
automatically.

I need to find all the occurrences of these type
mismatches so my Lua translation will work correctly.
Order comparisons like '<' and '>=' will throw a
runtime error, so I can catch them and fix the code.
However, '==' and '~=' always produce false and true
respectively for values that don't have the same type,
so I won't know that there is a type mismatch.

Does anyone have any suggestions as to how to catch
these errors?

Thanks.