Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!boring!guido From: guido@boring.uucp (Guido van Rossum) Newsgroups: net.lang.c Subject: Re: To dereference or not dereference Message-ID: <6840@boring.UUCP> Date: Sun, 23-Mar-86 21:13:28 EST Article-I.D.: boring.6840 Posted: Sun Mar 23 21:13:28 1986 Date-Received: Tue, 25-Mar-86 05:25:34 EST References: <196@aplvax.UUCP> <2600040@ccvaxa> <146@sdchema.sdchem.UUCP> <651@bentley.UUCP> Reply-To: guido@mcvax.UUCP (Guido van Rossum) Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam Lines: 17 Apparently-To: rnews@mcvax If I were to redesign C, function names would just be constant pointers to pieces of code, just like array names would be constant pointers (though alas they aren't because of sizeof -- sizeof for functions is undefined anyway). The syntax for a function call would require an expression of type function pointer to the left of the parenthesis. Function pointers couldn't be dereferenced. (I might leave unary * and & applied to functions in the language to achieve compatibility with existing programs.) It has been said that now one can't see whether f() calls a function named f or a function whose address resides in function pointer variable f -- it this really important? You don't know for array names or macros either (does a+1 reference variable a or macro a? If the answer is that macros should be upper case, sulerly you can invent a convention whereby to recognize function pointers). Guido van Rossum, CWI, Amsterdam (guido@mcvax.UUCP)