http://qs1969.pair.com?node_id=543715


in reply to Re: Perl 6: Static/Dynamic Strong/Weak Type Systems
in thread Perl 6: Static/Dynamic Strong/Weak Type Systems

I realize now that there is clearly no standard definition of "strongly typed".

For me it related to type casting pointers.

In "Weakly Typed" C/C++...

Foo f; Foo *pf = &f; Bar *pb = (Bar*) pf; Bar& b = *pf;

Here, f points to a piece of memory it will treat as if it was in the structure of a Foo. b points to *the same* piece of memory and instead it will treat as if it was in the structure of a Bar. Foo and Bar may have totally unrelated structures. This is what I was thinking of in terms of weak typing.

I thought you couldn't do that in Perl - hence I called in strongly typed.

(It looks like you might be able to something similiar with the pack/unpack magic mentioned above - although it is certainly not a common practice.)

-Andrew.

Replies are listed 'Best First'.
Re^3: Perl 6: Static/Dynamic Strong/Weak Type Systems
by Anonymous Monk on Apr 17, 2006 at 19:47 UTC
    My favorite take...
    So what is "strong typing"? This appears to be a meaningless phrase, and people often use it in a non- sensical fashion. To some it seems to mean "The language has a type checker". To others it means "The language is sound" (that is, the type checker and run-time system are related). To most, it seems to just mean, "A language like Pascal, C or Java, related in a way I can't quite make precise". If someone uses this phrase, be sure to ask them to define it for you. (For amusement, watch them squirm.)