bison-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] More %define/%code encapsulation


From: Paolo Bonzini
Subject: Re: [PATCH] More %define/%code encapsulation
Date: Wed, 17 Jan 2007 22:07:51 +0100
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)


I fail to see how this:

  b4_get_percent_code_ifval([[package]], [.])

is better than this:

  m4_ifval(b4_percent_code_get([[package]]), [.])

For one thing, it's an exception to the rule that m4 macros almost always accept quoted material.

In my opinion, if you want to make life easier for skeleton authors, give them less macros to understand. If they can't grasp how to compose small concepts into larger ones, they're in the wrong business, and they should at least stay away from any UNIX-like OS. As far as M4 quoting, they're going to have to understand it anyway if they're working with Bison's skeletons.

Yes, but we can at least provide something more consistent.

If we try to specialize every m4_FOO for every Bison construct, we're going to gradually create a large mess in bison.m4.

There is no other Bison construct to specialize for. In the case of _code, for example, only _ifdef may make sense; but I'd be more inclined to drop that one as it is unused, rather than all the b4_percent_define macros.

Previous to your reorganization of %define, it defined macros directly. While bad, this at least was relatively terse: m4_ifval([b4_package], [.]). I would like to rephrase this as b4_percent_define_ifval([package], [.]).

Since none of this appears to be documented, why don't we just drop the no-value form?

I kind of like `%define public', much more than `%define public "true"'. So I think it'd be a pity to remove it, but on the other hand I have no big objections. However, I would like to hear from Akim since he introduced it last July.

Paolo




reply via email to

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