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!godot!harvard!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA Newsgroups: net.lang.c Subject: initialization Message-ID: <7226@brl-tgr.ARPA> Date: Fri, 11-Jan-85 11:08:19 EST Article-I.D.: brl-tgr.7226 Posted: Fri Jan 11 11:08:19 1985 Date-Received: Sun, 13-Jan-85 08:21:46 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 24 /* bizarre idea time again! how about a 'data' statement? except we wouldn't call it that. have a bunch of code before (outside) any functions are defined. only stuff that the compiler could do as initialization (if the syntax allowed it) would be legal. what am i talking about? try this: int x[4]; union dues { char p; int q; float r; }; } z; /* ignore prev line, typing directly */ ... x[3] = 1; z.r = 3.14159; ... int func() { ... } one could even imagine for loops to initialize arrays, but this would require the compiler to be an interpreter as well. oh well. */