bug-m4
[Top][All Lists]
Advanced

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

Re: Remaining non-blind macros


From: Eric Blake
Subject: Re: Remaining non-blind macros
Date: Mon, 10 Jul 2006 06:18:53 -0600
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

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

According to Gary V. Vaughan on 7/10/2006 3:55 AM:
> Hi Eric!
> 
> Eric Blake wrote:
>> I just looked at the list of blind macros (those that must be
>> passed arguments to be recognized, such as define), and had
>> a couple of questions.  Most of the builtins that are not blind
>> have a reason; for example, dnl would be worthless if it were
>> blind.  And I already recently changed indir and format to be
>> blind.  However...

indir and format are GNU extensions, after all, so we have a bit more
freedom in their definitions.

>>
>> Any reason that shift is recognized even without arguments?
> 
> The only reason I can imagine is for compatibility with other
> implementations.  The stable branch shouldn't change the status
> quo, unless there is an actual (or at least potential) bug...
> however, if you can find another (popular!) implementation of
> M4 that has a blind shift macro, then our non-blind shift is
> definitely buggy! :-)

I don't have easy access to a BSD implementation of m4 right now, but I
just noticed on
http://www.freebsd.org/cgi/man.cgi?query=m4&sektion=1&apropos=0&manpath=freebsd
that they document having blind macros (but don't mention whether shift
and m4wrap are included in their list of blind macros).  I also noticed
they add the builtins expr (alias for eval), paste and spaste (where paste
is comparable to undivert(name)), and the command-line option -g; for
compatibility, we support support these features.  They have also copied
indir, but not format.

The way I envision things for CVS head is that all builtins that aren't
explicitly documented to have special behavior with 0 arguments should be
blind in gnu mode, and follow POSIX behavior in traditional mode.
Besides, it is easy enough to make a macro blind:
define(`shift', `ifelse(`$#', `0', ``$0'', `builtin(`$0', $@)')')

- --
Life is short - so eat dessert first!

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

iD8DBQFEskWs84KuGfSFAYARAlNNAKCCvYE+AyMopEhpsohTEpHyU6cNxQCgjFPf
XTnafJJcb+DvkeO76KelZ+g=
=CfpQ
-----END PGP SIGNATURE-----




reply via email to

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