Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Rui Maciel Newsgroups: comp.programming Subject: Re: Suggestions for a preprocessor Date: Mon, 28 May 2012 12:32:13 +0100 Organization: Aioe.org NNTP Server Lines: 36 Message-ID: References: <500cea953a95c9b8c8212d840d9558a9@msgid.frell.theremailer.net> Reply-To: rui.maciel@gmail.com NNTP-Posting-Host: AqItoBXOUTdaiWbH4r55cA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.8.2 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.programming:1633 Fritz Wuehler wrote: > Rui Maciel wrote: > >> If you were given the task of generating a set of text files whose >> different versions differed only in a set of numerical values, which tool >> would you choose? > > diff? The objective is to generate a set of files with present different values specified by a parameter. For example, let's assume we have this template: Line (0,0) (XX,YY) And, based on this template, a user intended to define N different data files, each one with different values for (XX, YY), with the values for XX and YY being defined in terms of an arbitrary algebraic expression. >> The first tool that jumped to my mind was the M4 preprocessor, but it >> appears it doesn't handle algebraic operations that well. > > m4 doesn't seem to do anything well except edit sendmail.cnf files After a bit of digging, I also ended up with the idea that m4 is limited to the point it is essentially useless. Someone correct me if I'm wrong, but it appears m4 only supports algebraic operations on integers. If it doesn't support floating point operations, or even decimal fractions, then it is essentially irrelevant for any task which involves non-integer numberical values. Rui Maciel