lua-users home
lua-l archive

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


In lua5.3, numbers now represent integer and float, which in previous versions, would only represent float. For what I read, it was done so bitwise operations could be done in a more natural way.

Thinking about it, this change created an exception for lua types, that is, while all other types represent "basically" one thing, number now represents two things (int and float). And they are not "really" the same thing, even though they're, obviously, both numbers. 

So, question: why wasn't strings used for bitwise support, given they are ... well, regular byte sequences ... that way, number could continue being only float.
And: why not split "number" into int and float? Wouldn't that make code more predictable? Maybe even more natural.


--
"A arrogância é a arma dos fracos."

===========================
Me. Italo Moreira Campelo Maia
Co-fundador do Grupo de Usuários Python do Ceará
Secretário ForHacker (fb.com/ForHackerSpace)
Desenvolvedor Full-Stack, Escritor, Empresário, Visionário
-----------------------------------------------------
Meu Livro, Site, Blog
===========================