Hello.
Learning language Lua. I am trying to understand the cocenput moment: there are only three atomic data types in the language: 1. boolean 2. Number 3. String
As for Number, delving into the configuration file https://www.lua.org/source/5.1/luaconf.h.html
there is the following definition:
#define LUA_NUMBER double There is no int type but there is a built-in interpreter:
LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) { TValue n; const TValue *o = index2adr(L, idx); if (tonumber(o, &n)) { lua_Integer res; lua_Number num = nvalue(o); lua_number2integer(res, num); return res; } else return 0; } Can anyone give arguments for and against such a conceptual structure of the language and its atomic data types?
How does this help, how does it complicate work in general?