strong/weak typing and pointers

Steven Bethard steven.bethard at gmail.com
Wed Nov 3 03:14:27 EST 2004


Mike Meyer <mwm <at> mired.org> writes:
> 
> Finally, I don't see that there's that much difference between the two
> different definitions of 'weakly typed'.  Both can be described as
> treating an object as if it were of some type other than what it
> really is. In one case, you abuse the raw bits, and in the other you
> coerce the object to a different type.

One other thing:  If you lump coercions with weak-typing, you allow the code
written in a language to adjust the degree of "weakness" of a language.  Any
language (like Python) that allows you to override operators allows you to
create new coercions[1].  So if I don't like the strong/weak classification of
my language, I can always make it more "weakly-typed" by just adding more
nonstandard coercions.

IMHO, classification of a language as strongly- or weakly-typed should be
invariant of the code written in a language -- it should be something associated
with the language definition itself.  Lumping weak-typing with coercion makes
this impossible.

Steve

[1]http://mail.python.org/pipermail/python-list/2004-November/249023.html




More information about the Python-list mailing list