Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: A Deficiency of the C Preprocessor Message-ID: <4863@mimsy.UUCP> Date: Sat, 20-Dec-86 14:36:39 EST Article-I.D.: mimsy.4863 Posted: Sat Dec 20 14:36:39 1986 Date-Received: Sat, 20-Dec-86 22:37:12 EST References: <1259@kontron.UUCP> <1888@batcomputer.tn.cornell.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 41 >In article <1259@kontron.UUCP> cramer@kontron.UUCP (Clayton Cramer) writes: >>I've got a complaint about the C preprocessor -- I doesn't support a >>repetition for initializing data structures. Why is this a complaint about the preprocessor? The preprocessor knows nothing about data structures. (I do think it might be neat to have loop constructs in the preprocessor. E.g., to unroll a loop, instead of writing *p++ = 0; *p++ = 1; *p++ = 2; *p++ = 3; *p++ = 4; *p++ = 5; *p++ = 6; *p++ = 7; one could write #for (i = 0; i < 8; i++) { *p++ = i; #} A fully programmable preprocessor would at least make a fun toy. :-) [Of course, you can always write your own preprocessor.]) In article <1888@batcomputer.tn.cornell.edu> braner@batcomputer.tn.cornell.edu (braner) writes: >I would like, if not that, at least an acceptance by the preprocessor >of more parameters than required. I find this even more confusing. The only `parameters' in the preprocessor are those given to macros. A preprocessor that silently ignored extra arguments to a macro would be quite annoying. >As for compile vs. run time initialization of arrays: A compiler I >use creates code for all the initializations in the program ... >Even worse, when an array is initialized, this compiler generates a line >of code to initialize each entry, rather than an image of the array and >looping code. That sounds like a pretty poor compiler to me. Whose is it, that we may all avoid buying it? -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) UUCP: seismo!mimsy!chris ARPA/CSNet: chris@mimsy.umd.edu