[Top][All Lists]

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

Re: m4sugar update

From: Eric Blake
Subject: Re: m4sugar update
Date: Wed, 27 Aug 2008 06:12:45 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080708 Thunderbird/ Mnenhy/

Hash: SHA1

According to Akim Demaille on 8/27/2008 2:58 AM:
> I have not looked at the details, but there is something that makes
> shiftn(3, $@) and shift3($@) different.  If in the branch
> candidates/make-symbol you change the shift3 into a shiftn, then
> "_build/tests/bison examples/variant.yy" loops forever.

I only know of one difference between the macros.  shiftn validates that
there are enough arguments to shift, so shiftn(3,$@) throws an assertion
unless $@ contains more arguments than the shift count, and it should be
impossible to call it with 0, 1, 2, or 3 arguments.  On the other hand,
shift3 does no validation; if $@ contains 0, 1, or 2, or 3 arguments,
shift3 silently results in an empty string (which, if you called shift3
after a comma, still results in 1 argument for the next round).  I'm not
sure what you are using as your check to end recursion, nor how using
shift3 could cause an infinite loop, unless you are looping even when
shift3 resulted in an empty string; but this seems like the shiftn variant
would have asserted.

I haven't tried to build the candidates/make-symbol branch, but I suppose
I can look into this further.  Do you know which macro is looping
infinitely?  A quick 'git grep m4_shiftn origin/candidates/make-symbol'
didn't turn up any use of m4_shiftn outside of m4sugar.

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

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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