[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in M4
From: |
Andreas Schwab |
Subject: |
Re: Bug in M4 |
Date: |
Tue, 04 Jan 2005 01:54:51 +0100 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
"Sam Lauber" <address@hidden> writes:
> I was using GNU M4 1.4.2, and typed in the following recursive additive macro:
>
> define(`add', `ifelse($1, 0, $2, add(decr($1), incr($2))')
>
> I then typed `add(1, 1)'. Obviously, I expected it to say `2', but it said
>
> `Recursion limit of 250 exceeded; use -L<N> to change'
>
> I consider this a bug,
It is, in your macro. Fix the quoting and paren nesting.
define(`add', `ifelse($1, 0, `$2', `add(decr($1), incr($2))')')
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."