From: Regg Date: 2006-05-16T04:04:15+09:00 Subject: Re: begining programmer questions In your example: " struct vector a = {2.0, 3.0, 4.0}; struct some24ByteStuct b = (struct some24ByteStruct)a;" You are manually forcing this relationship my casting one type to another. To me that is one of the things I love about C is that it will allow you do something that the compiler otherwise would not allow. But in Ruby you are not "forcing" the type casting, it just does it without any warning or error. So I still can't see how it can be said that "Ruby is a dynamically, strongly typed language". It seems to be a dynamically, "any" typed language. What benefit is gained from a variable being (switched/pointed to) from one type to another? (This is an honest question, maybe I'm missing something) It seems like a recipe for disaster. Thanks > C is a statically, weakly typed language. It is static because a > variable can only be on a certain type, but it is weak because the > data associated with that variable can be of any type. For example > (untested and syntax may be bad): > > struct vector { > double x, y, z; > }; > > struct some24ByteStruct { > int a, b; > char c, d, e, f; > double g, h; > }; > > struct vector a = {2.0, 3.0, 4.0}; > struct some24ByteStuct b = (struct some24ByteStruct)a; > > We know that we have some integers (b.a and b.b), some characters > (b.c, b.d, b.e, and b.f), and some doubles (b.g and b.h), but this is > scary stuff since we have no idea what kind of data will be in those > variables. The former point is what makes C statically typed, but the > latter point makes it weakly typed. > > Ruby is a dynamically, strongly typed language. It is dynamic because > a variable can point to data of any type, but strong because that > data will never change type. The Ruby example I gave above > demonstrates this. > > Make any more sense now? > > - Jake McArthur -- Posted via http://www.ruby-forum.com/.