|
ketmar wrote: Your example is contrived to show this one case where they perform the same.
can't see any "type name" here. and so does Lua. give your object "tostring" metatmethod, and it will be fine. no magick here, no magick there. it's only a coding discipline.
If you honestly beleive that, then the only conclusion is that the Javascript guys care more about what they are doing.
I've seen the results, I know what they show. I don't agree with you. I wouldn't raise this point if I thought Lua did as well as JS. It doesn't. I prefer Lua to JS, so I'm not trying to score points against Lua.
There are a lot of built in types in JS. Don't beleive me? - please examine the Firefox source.
JS is so much better than Lua in this regard. This may be a weakness in JS in some cases, but its worse in Lua (and every case where JS fails, Lua fails also, but not vice versa).
Stephen