C strongly typed?

Charles Hannum CMH117 at psuvm.psu.edu
Mon Mar 12 00:22:53 AEST 1990


In article <873 at enea.se>, sommar at enea.se (Erland Sommarskog) says:
>
>Stupidity. Ever heard of the work "mistake"? Say that I have the
>routine Macedonia declared as (in Ada syntax):
>
>   FUNCTION Macedonia(Granny_smith : IN Apple;
>                      Tangerine    : IN Orange) RETURN Some_type;
>
>Now, I'm calling this from another module. In which order comes
>the parameters now? Ah, it was probably the orange first, wasn't
>it? A strongly typed language like Ada will catch this error.
>With C or Pascal I have to spend half a day to find out why the
>damned fruit salad doesn't taste as intended.

Your point is well taken.  While I do often find C's liberal number conversion
useful, it is also annoying that I can't defined a new type, without defining
it as a structure (or union).

Oh well.  Fortunately, I haven't ever run into an application where I really
desparately needed name equivalence in anything but structured.  Perhaps some
day I will.

Then I'll switch to Eiffel.


Virtually,
- Charles Martin Hannum II       "Klein bottle for sale ... inquire within."
    (That's Charles to you!)     "To life immortal!"
  cmh117 at psuvm.{bitnet,psu.edu}  "No noozzzz izzz netzzzsnoozzzzz..."
  c9h at psuecl.{bitnet,psu.edu}    "Mem'ry, all alone in the moonlight ..."



More information about the Comp.lang.c mailing list