Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site dataio.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!tektronix!uw-beaver!uw-june!entropy!dataio!bright From: bright@dataio.UUCP (Walter Bright) Newsgroups: net.lang.c Subject: Re: C standard for initializations Message-ID: <722@dataio.UUCP> Date: Mon, 22-Jul-85 05:38:46 EDT Article-I.D.: dataio.722 Posted: Mon Jul 22 05:38:46 1985 Date-Received: Thu, 25-Jul-85 08:13:05 EDT References: <5@brl-tgr.ARPA> Reply-To: bright@dataio.UUCP (Walter Bright) Organization: Data I/O Corp., Redmond WA Lines: 20 In article <5@brl-tgr.ARPA> ALMQUIST@SU-SCORE.ARPA (Philip Almquist) writes: > 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 > } A good idea. But I would rather see the syntax be: int foobar[FOOSIZE] = {1,2,3 #repeat (FOOSIZE - 3) ,27 }; Most C preprocessors are already set up to handle text on the current line, not text on n lines. My scheme would be much easier to implement. The repeat count would have to be enclosed in parentheses in order to differentiate it from the repeated text. Large amounts of repeat text can be handled with a \ continuation character, just like in #defines.