autoconf-patches
[Top][All Lists]
Advanced

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

Re: M4 syntax $11 vs. ${11}


From: Eric Blake
Subject: Re: M4 syntax $11 vs. ${11}
Date: Thu, 08 Feb 2007 12:47:13 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paul Eggert on 2/8/2007 12:20 PM:
> Can you please rewrite this so that it invokes m4 once instead of
> twice, and doesn't use grep at all?  You can use Perl's pattern
> matching instead of grep.  And I think you can test for both features
> by a single call to 'm4'.  This will help autom4te start up a bit
> faster.

I was just copying what was already there, but yes, I will try to optimize
this and resubmit.

> 
> Perhaps it would be even better to test for these things at
> configure-time: that way, we won't have to invoke 'm4' at all, at
> run-time.

I thought about that, but it is not as smooth an upgrade path - a user
that installs autoconf 2.62 while m4 1.4.8 is installed, then upgrades to
m4 1.4.9, won't get the benefit.  Besides, prior to last week's patch to
check for 1.4.5 in configure, we were already duplicating the check for m4
1.4 or greater in both configure and autom4te.

> 
> A nit: the "+" isn't needed.  Once you see two digits, you don't need
> to look for more.

But the error message is different depending on whether the + is present:

$ m4 --warn-macro-sequence='\$[0-9][0-9]' <<\EOF
> define(foo,$001)
> EOF
m4:stdin:1: Warning: definition of `foo' contains sequence `$00'

$ m4 --warn-macro-sequence='\$[0-9][0-9]+' <<\EOF
> define(foo,$001)
> EOF
m4:stdin:1: Warning: definition of `foo' contains sequence `$001'

$

I thought it more user-friendly to pick up the entire string of digits,
rather than stopping at the second.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFy35B84KuGfSFAYARAmz0AJ4/LglpE5cgnDyyifZhdOjzfhFQmwCgwU7x
WxCsorZLQDEWLqhUERrjc9w=
=OWjr
-----END PGP SIGNATURE-----




reply via email to

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