Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!brl-tgr!tgr!ALMQUIST@SU-SCORE.ARPA From: ALMQUIST@SU-SCORE.ARPA (Philip Almquist) Newsgroups: net.lang.c Subject: Re: C standard for initializations Message-ID: <5@brl-tgr.ARPA> Date: Thu, 18-Jul-85 20:40:48 EDT Article-I.D.: brl-tgr.5 Posted: Thu Jul 18 20:40:48 1985 Date-Received: Sat, 20-Jul-85 05:25:06 EDT Sender: news@brl-tgr.ARPA Lines: 32 An alternative which would accomplish the end would be to add a repetition construct to the preprocessor. An example, using one possible syntax, is: int foobar[FOOSIZE] = { 1, 2, 3 # repeat FOOSIZE - 3 ,27 # endrepeat } I believe that such a preprocessor directive would have the following advantages over the (very reasonable) scheme that you proposed: - It also handles repetition in other cases where it can be useful, such as loop unrolling. - Macro processors tend to be easier to change than compilers. - Although I didn't think about it hard enough to be sure, I think that there are cases in your syntax where the accidental insertion or deletion of a comma could change the meaning of the initializer radically without causing any sort of compile-time error. Since commas naturally abound in initializers such an error might be hard to spot. Although such pitfalls abound in C it would be nice to avoid adding another one. Philip Almquist -------