[OT] Type-checking (was Re: Python Strings)

Darren New dnew at san.rr.com
Wed Sep 6 21:42:20 EDT 2000


Keith Ray wrote:
> By these definitions, some dialects of Pascal are "weakly statically
> typed" because those dialects have a type-cast syntax, and other
> dialects of Pascal are "strongly statically typed" because those other
> dialects don't have type-casts.

Well, it depends on whether the type-cast really changes the value or not.
For example, in C, there are two kinds of type casts:

int i; float j;
j = (float) i; /* That's a strongly-typed type cast */

int * i; float * j;
j = (float *) i; /* That's a weakly-typed type cast */

> Other people, who have built large systems in Smalltalk for example,
> know that large systems can be built, as long as there is enough testing
> and discipline in creating that system.

Actually, there are some folks who argue that large systems are *harder* to
build with strict type checking. 

> "References" to objects allocated in the heap are the normal usage in
> Smalltalk, Object Pascal, Objective-C, Python, Oberon?, Modula3?, some
> object-oriented dialects of Forth, and just about every other OO
> programming language that I've heard of.  C++ is, as far as I know, the
> only language that allows objects to take space on the stack instead of
> the heap.

To be fair, in Smalltalk, the stack is allocated in the heap (which is very
cool), so truth is stranger than fiction sometimes. ;-)

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST).  Cryptokeys on demand.
"No wonder it tastes funny. 
            I forgot to put the mint sauce on the tentacles."



More information about the Python-list mailing list