Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
thaumasiotes
10y ago
0 comments
Share
> Lua tables accept arbitrary objects as keys, and make a difference between `foo[1]` and `foo["1"]`.
That sounds... completely normal? Python dictionaries will do that too. So will Java HashMaps.
0 comments
default
newest
oldest
sirclueless
10y ago
That comment was responding to a comment about PHP and JS, both of which do
not
make such a distinction.
seabee
10y ago
There is another subtlety that values associated with integer keys are stored as an array. dicts and HashMaps don't do this.
adrusi
10y ago
And not even all integer keys! Lua will efficiently handle sparse arrays using tables.
j
/
k
navigate · click thread line to collapse