[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: m4_defun_init
From: |
Paolo Bonzini |
Subject: |
Re: m4_defun_init |
Date: |
Sat, 25 Oct 2008 12:57:03 +0200 |
User-agent: |
Thunderbird 2.0.0.17 (Macintosh/20080914) |
Eric Blake wrote:
> Paolo Bonzini <bonzini <at> gnu.org> writes:
>
>> I'm not sure tracking the location is not useful. As a first step, you
>> can use m4_define if the common version is empty and m4_defun otherwise.
>
> I don't see why the common would ever usefully be empty (just use
> m4_defun_once
> or m4_expand_once instead, if you have initialization but no body).
m4_defun_once warns if the macro is called more than once.
> Ah. m4_fatal uses m4_expansion_stack_dump, which does indeed have less
> information if location is not being tracked. Perhaps we could change the
> common definition from its current:
>
> $2
>
> to the more complex:
>
> m4_expansion_stack_push(_m4_defn(
> [m4_location($1)])[: $1 is expanded from...])$2[]m4_expansion_stack_pop()
>
> while still trimming out the diversion manipulation in _m4_defun_{epi,pro},
> so
> that we are still lighter weight than a full blown m4_defun on the common
> code.
Yes, pretty much.
Paolo