[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] b4_args is more general than only C++.
From: |
Akim Demaille |
Subject: |
Re: [PATCH] b4_args is more general than only C++. |
Date: |
Wed, 26 Nov 2008 09:51:18 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) |
>>> "EB" == Eric Blake <address@hidden> writes:
>> +2008-11-25 Akim Demaille <address@hidden>
>> +
>> + b4_args is more general than only C++.
>> + * data/lalr1.cc (b4_args, _b4_args): Move to...
>> + * data/bison.m4: here.
>> +m4_define([b4_args],
>> +[m4_if([$#$1],
>> + [1], [],
>> + [m4_ifval([$1],
>> + [$1[]_$0(m4_shift($@))],
>> + [$0(m4_shift($@))])])])
> This implementation is quadratic on M4 1.4.x. Wouldn't you rather
> use a linear implementation? Recently, there has been a lot of
> churn in autoconf.git's copy of m4sugar making it even faster;
> it is probably time for me to post a resync patch again. But one
> of those improvements is the addition of m4_map_args_sep; the
> following is a linear implementation (with less text, to boot):
> m4_define([b4_args],
> [m4_shift(m4_map_args_sep([_$0(], [)], [], $@))])
> m4_define([_b4_args], [m4_ifval([$1], [, $1])])
There is no m4_map_args_sep in Bison. I don't know what's the status
bw m4sugar in Autoconf and in Bison. Did they finally converge? In
which case we should probably add autoconf.git as a submodule and deal
with bootstrap to import the appropriate files in bison. That would
make it easier to keep them synch'ed.