SLUG Mailing List Archives
Re: dynamic vs static type checking (was Re: [SLUG] Your top-ten linux desktop apps)
- To: slug@xxxxxxxxxxx
- Subject: Re: dynamic vs static type checking (was Re: [SLUG] Your top-ten linux desktop apps)
- From: yiz@xxxxxxxxxxxx
- Date: Mon, 26 Sep 2005 21:20:10 -0500
- User-agent: Internet Messaging Program (IMP) H3 (4.0.3)
However, other dynamically typed languages like Python, php and to a
lesser extent Perl do not have anywhere near as sane a system. I
suspect that the Smalltalk equivalent of the following Python code
might actually do the right thing:
a = [ 1, "help" ]
b = a + 10
but Python squeals like a stuck pig (read runtime error).
So it should ... just because a language is made for the ease to use does not
mean it should just accept any random input and not to complain.
b = a + 10 isn't exactly programmingly intuitive, it could potentially mean:
I) b = [l, "help", 10]
II) (if l is of type int) b = [l+10, "help"]
III) b is the address of a plus 10 units.