Why are typedef names in the same name space as variable names?
Bill Wohler
wohler at sri-spam.istc.sri.com
Tue Nov 18 16:22:41 AEST 1986
In article <2183 at sdcsvax.UCSD.EDU> bruss at sdcsvax.UUCP (Brian Russ) writes:
> If [typedefs and variables] weren't in the same name space,
> you could, in addition to the above, write:
>
> struct foo { /* ... */ };
>
> foo foo;
>
> Yuch! Do you really want/need this flexibility? In my opinion,
>it's better the way it is now.
i haven't thought of an example which would necessitate having
typedefs and variables in the same name space. it is very common
to have:
struct foo {...};
...
struct foo foo;
thinking of different names for the structure and the variable
becomes difficult when we just hack and don't expand our
vocabulary reading faulkner or didion. ;-)
--bw
More information about the Comp.lang.c
mailing list