Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!alice!ark From: ark@alice.UucP (Andrew Koenig) Newsgroups: net.lang.c Subject: Re: What should be added to C Message-ID: <5498@alice.uUCp> Date: Tue, 20-May-86 12:18:09 EDT Article-I.D.: alice.5498 Posted: Tue May 20 12:18:09 1986 Date-Received: Fri, 23-May-86 06:24:48 EDT References: <1462@mmintl.UUCP> Organization: Bell Labs, Murray Hill Lines: 61 Frank Adams says: > As has been noted, one should use restraint in adding new features to a > language. What follows is a list of the features I would support adding to > the *next* version of C (after the current standard is complete). OK, let's see his examples of "restraint:" > o Min and max operators. These would get used all over the place. These > should be usable to the left of the assignment operator, as most but not all > C operators are. What would it mean to use these on the left of an assignment, and why would you want to use it? > o An andif clause for if statements. What does it do and how would you use it? > o The ability to define multi-line pre-processor macros, using #begdef and > #enddef statements. #if and other conditionals in the body of the > definition would be evaluated when the macro was not interpreted, not when > it is encountered. Why would you want to use it? > o A typeof operator, similar to sizeof. What would its value be? Why would you want to use it? > o := as a synonym for =. Compilers could have an option to permit := only. Why bother? > o Permit a continue statement in switch, meaning that the next label should > be fallen through to. Compilers and/or lint could produce when a program > falls through without a continue statement. A continue statement is already legal in a switch, as long as that switch is enclosed in a for or while. It means go on to the next iteration of the enclosing loop. Are you proposing to change this? > o Any sort of multi-level break statement. There is no syntacticly clean > way of adding this to C. C already has a multi-level break statement. It's spelled "goto." Putting a goto in a costume doesn't disguise it. > o Elimination of the eight-character truncation of internal variable names > done by some compilers. (This may be in the current spec; I haven't read > that document.) The entire length of a variable name should be significant. Most compilers do this already. The trouble with adding new features to C is that there is a very strong incentive not to use them. After all, any program that uses some new feature is only going to run on machines that support that feature. I don't think I'm going to be using only one compiler for the rest of my life and would like to avoid changing my code every time the environment hiccups.