Dr.Ruud wrote: > Rob Thorpe schreef: > > Dr.Ruud: > >> Marshall: > > >>> "dynamic types." I don't have a firm definition for > >>> that term, but my working model is runtime type tags. In which > >>> case, I would say that among statically typed languages, > >>> Java does have dynamic types, but C does not. C++ is > >>> somewhere in the middle. > >> > >> C has union. > > > > That's not the same thing. > > That is your opinion. In the context of this discussion I don't see any > problem to put C's union under "dynamic types".
Lets put it like this:- 1. In C++ and Java it is possible to make a variable that can A)Take on many different types and B)Where the programmer can test what the type is. 2. In C it is possible to make a variable that can do 1A but not 1B. This is a statement of fact, not opinion. I call languages that do #1 dynamically typed, in line with common usage. > > The value of a union in C can be any of a > > set of specified types. But the program cannot find out which, and > > the language doesn't know either. > > > > With C++ and Java dynamic types the program can test to find the type. > > When such a test is needed for the program with the union, it has it. What do you mean? There is no way to test the type of the value inside a union in C. -- http://mail.python.org/mailman/listinfo/python-list