m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX vs. eval


From: Gary V. Vaughan
Subject: Re: POSIX vs. eval
Date: Wed, 3 Jan 2007 17:20:28 +0000

On 3 Jan 2007, at 14:31, Eric Blake wrote:
Hi Gary, and happy new year,

A Happy New Year to you and all M4teans :-)

According to Gary V. Vaughan on 12/29/2006 1:27 PM:
I think the only change in the POSIX wording would be to remove
the forbid aspect, and instead list all the required operators.

Here's the aardvark I finally submitted:
https://www.opengroup.org/sophocles/show_mail.tpl? CALLER=index.tpl&source=L&listname=austin-review-l&id=2250

Perfect!

In preparing the aardvark, I also realized that it may be worth adding the following GNU extension in m4 2.0. Currently, if eval encounters a word
(ie. macro name), it is a syntax error.  But we could check if the
definition of that macro is a number, and thus support variables; once
variables are supported, we can then also support assignment operators. Thus "define(a,1)ifelse(eval(`a++'))a" would expand to "2", similar to the
shell construct "a=1; : $((a++)); echo $a".

Ooo!  Yes indeed, that would certainly be a very powerful addition to
the m4 toolkit :-)  Nice job.

Cheers,
        Gary
--
Gary V. Vaughan      ())_.  address@hidden
Research Scientist   ( '/   http://blog.azazil.net
GNU Hacker           / )=   http://www.gnu.org/software/{libtool,m4}
Technical Author   `(_~)_   http://sources.redhat.com/autobook




Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]