[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: OT: Strict typing on large projects

Weirich, James

10/17/2003 9:54:00 PM

> C is a weakly typed language because, with casts, you can make the
> compiler treat any memory location as any type you'd care to.

Actually, you don't even need casts to demonstrate weak typing in C.
Consider:

extern void f();
f(1.3);

Combined with the following definition in a separate file ...

void f(int d) { ... }

Or in one line ...

printf ("%d", 1.3);

And not all casts are created equal. "(double)int_var" is fine, even in a
strong/static typed language. "(double*) &int_var" is NOT fine.

--
-- Jim Weirich / Compuware
-- FWP Capture Services
-- Phone: 859-386-8855