3 ms·
I love AWK. Its stringly-typedness would make a Javascript programmer blush: 0, “”, and actually-nothing are identically falsey. Numbers are no different from s
by bagful 3y ago
I love AWK. Its stringly-typedness would make a Javascript programmer blush: 0, “”, and actually-nothing are identically falsey. Numbers are no different from strings representing numbers, like Lua. Somehow, I don’t mind — if you really need to keep your numbers numbers and strings strings, sigilate the value (prepend with #/$) and peel it off with a substr() later.
- garaetjjte 3y agoLua does not represent numbers with strings. It does have number type which is always floating-point.
- nmz 3y agoIntegers were introduced in 5.3.
- samatman 3y agoI like the way Lua handles strings and numbers quite a bit. They're different types, but arithmetic will convert a string to a number when it can. This is without footguns, because concatenation is a different operator entirely. 2 + "3" -- 5 2 .. "3" -- "23" It's rather convenient, especially when you can combine it with LPeg to parse files with numbers in them, then do the maths directly.