Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!ius2.cs.cmu.edu!edw From: edw@ius2.cs.cmu.edu (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: Function prototypes (was: miscellaneous unrelated stuff) Message-ID: <1169@ius2.cs.cmu.edu> Date: Wed, 20-May-87 10:27:19 EDT Article-I.D.: ius2.1169 Posted: Wed May 20 10:27:19 1987 Date-Received: Sat, 6-Jun-87 12:04:05 EDT References: <18346@ucbvax.BERKELEY.EDU> <8042@utzoo.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 35 It seems to me that function prototypes violate a basic good rule about high programming language design which is : avoid having the user declare the same information more than once. As I understand, function declarations are still require in all there entirety. The same information is presented in function prototypes. The user is require to state approximately the same thing twice. The functionality of function prototypes is still useful though, to push the information about a function around to other modules. There is an ugly(?) alternative that will provide the same functionality. It will remove the burden from the user to the compiler. A optional approach is have the compiler generate the function prototype information ahead of time. Maybe another preprocessor stage to the compiler. *.fp files could automatically be create with all the function prototype information in them. The user would have a small task of including the appropriate *.fp files (not necessarily using #include). If stronger scoping requirements are needed then maybe a version of import should be adopted. How about: extern foobar() : foobarmodule; or foobar() : foobarmodule; In which case the user wouldn't have to include any new files since the information about what new files to use would be in the import from field of the external statement. I haven't worked out all the details to a feature like this. I'm sure there are some posible bad interactions between already existing features, but it's food for thought. -- Eddie Wyatt e-mail: edw@ius2.cs.cmu.edu