Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!inuxc!pur-ee!uiucdcs!ccvaxa!aglew From: aglew@ccvaxa.UUCP Newsgroups: net.lang.c Subject: Re: What should be added to C Message-ID: <2600058@ccvaxa> Date: Wed, 28-May-86 15:01:00 EDT Article-I.D.: ccvaxa.2600058 Posted: Wed May 28 15:01:00 1986 Date-Received: Fri, 30-May-86 08:32:20 EDT References: <1463@mmintl.UUCP> Lines: 38 Nf-ID: #R:mmintl.UUCP:1463:ccvaxa:2600058:000:1457 Nf-From: ccvaxa.UUCP!aglew May 28 14:01:00 1986 ~> Things that should/could be added to C, or C++, or... typeof typeof would be a compile time operator that would have a (possibly compressed and tokenized) form of the type used in declaring its argument (a variable) inserted in its place. If the C preprocessor ever gets sophisticated enough to be a true macro processor, typeof should return a string that macro operations can parse and disassemble as they will. In particular, typeof(typedef-name) should return the type used in declaring the type-name, and so on. lambda Wherever you may have a variable, it should be possible to substitute a literal constant of the appropriate type. C fails this test for arrays, which hasn't been so serious for the applications I've seen (I don't like having to declare COMPLEX constants as initialized variables, but C has so many other weaknesses for constants that I don't care - I'll wait for C++ constructors) -- more importantly, C also fails this test for function-pointers. When I pass a function pointer to, say, an integration routine, I would like to not have to go to the bottom of the file somewhere and write the function. f it's a short, anonymous function that I'm not going to use anywhere else, I want to declare it in place. I've used preprocessors that let you do this: integrate(from,to, float lambda(x) float x; {return x*x;} ) and move the declaration to the end and create a special name for it.