From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <40646AD9.7030304@swtch.com> From: Russ Cox User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4 MIME-Version: 1.0 To: 9fans@cse.psu.edu Subject: Re: [9fans] ports update References: <051da330d0a61ef476d5c5bdf2f1f98d@plan9.escet.urjc.es> In-Reply-To: <051da330d0a61ef476d5c5bdf2f1f98d@plan9.escet.urjc.es> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 26 Mar 2004 12:39:37 -0500 Topicbox-Message-UUID: 4418e15a-eacd-11e9-9e20-41e7f4b1d025 Fco.J.Ballesteros wrote: >Do you mean that you use global search and replace both to >translate anonymous struct/unions to named ones and >also to translate array initialization syntax? > > Yes, but different search-and-replaces. >Initialization syntax can be hard to do that way, unless I'm >missing something obvious (eg. like it existing now in the std). > > It's easy to turn int x[10] = { [a] 1, [b] 2, [c] 3, }; into int x[10]; static void initx(void) { x[a]= 1; x[b]= 2; x[c]= 3; }; and then call initx() from somewhere appropriate. > Do you have the translator at hand anyway? I'd have to dig it up and it doesn't entirely work. Russ