Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!lambda!jlg From: jlg@lambda.UUCP (Jim Giles) Newsgroups: comp.lang.misc Subject: Re: Anyone want to design a language? Message-ID: <14248@lambda.UUCP> Date: 22 Feb 90 23:34:50 GMT References: <18172@megaron.cs.arizona.edu> Lines: 27 From article <18172@megaron.cs.arizona.edu>, by mike@cs.arizona.edu (Mike Coffin): > [...] > A correction for those readers not familiar with C: the above is not > true. Arrays and pointers are different beasts. The confusion arises > because array names are *converted* to pointers when passed as > parameters and because the [] operator can be used on both. To make > an analogy, in both Fortran and C, integers are sometimes converted > automatically to reals (floats in C) and many of the same operators apply > to integers and reals but that doesn't mean that Fortran and C don't > really _have_ an integer data type. A correction for those readers not familiar with C: the above is not true. Arrays are pretty useless unless you can pass them around as procedure arguments. C converts all arrays to pointers when passing them to procedures. AND: YOU _CAN'T_ CONVERT THEM BACK ONCE YOU'RE THERE!!!!! They are not treated as arrays anywhere except the scope in which they were declared - and CAN'T be treated as arrays anywhere except their home scope. To make an analogy, it's as if, once an integer was converted to real, it could _never_ be converted back! And normal usage of integers _forces_ you to convert them to real on frequent occasions. So that, in effect, you really _DON'T_ have integers. Fortunately, even C doesn't really do this to integers. But is DOES do the corresponding thing to arrays. J. Giles