cs450a03@uc780.umd.edu (03/30/91)
First off, here's the cheap shot:
printf("%s%d%s%c", "one", "two", 3);
The moral of the story is that there is a difference between an
ability and a feature, though ability is a prerequisite for feature.
Oh yeah, by the way, this is:
yet-another-article-on-static-and-dynamic-typing
----------------------------------------------------------------------
I caught myself admitting that C can do dynamic typing. But then I
started thinking about various C programs I'd dealt with.
The irony is that people used to static typing have been saying "well,
if you have run-time type checking, then when you have a type error in
your program, the machine will go off into never-never land until it
eventually hits a type error" when this is exactly the case run-time
type checking is supposed to catch.
----------------------------------------------------------------------
I have also seen statements that seem to imply that run-time type
checking precludes type-casts. This is an implementation issue, not a
fundamental issue. Note that you could have either a C-like cast, or
one that casts from a specific type (say integer) to a specific type
(say character)--in either case, you'd get a simple function that
stuffs an appropriate value into the type field of its result.
----------------------------------------------------------------------
Finally (while I'm picking on C :-) consider
extern array[]; int foo[sizeof array];
----------------------------------------------------------------------
Your mileage may vary.
Raul Rockwell