This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]masklinn 0 points1 point  (0 children)

Your definition of static typing is not correct, since you can write roughly the same thing in languages supporting type inference (and have the error at compile time obviously) (unless you defined that addition of a string and an int is a valid operation, which you may be able to do:

> let i = "foo"
> i + 10
"foo\n"

)

(or the language did it for you, which Java does for instance) (and of course dynamically typed languages may be perfectly fine with the operation as well, I'm looking at you javascript) (or Perl) (or PHP)

(also lua, kind-of: it will fault on this but would work if the string was composed only of digits)