Hi Matthieu,

Matthieu Pupat wrote:
> I try a simple macro that prepone a sharp (#) before names beginning
> with i or o and quoting other names :
> 
> define(`QuoteVariable', `ifelse(substr($1,0,1), i, #$1,
> ifelse(substr($1,0,1), o, #$1, "$1" ) ) ')

[...]

> Is this a bug ?

Nope, your macro is underquoted so the # is treated as a comment as the
macro expansion stack unwinds.

> What can I do to get rid of this ?

Add more quotes!  I haven't tested this, but something more like this
should give you more success:

define(`QuoteVariable',
`ifelse(`substr(`$1', 0, 1)', `i', `#$1',
  `ifelse(`substr(`$1', 0, 1)', `o', `#$1', `"$1"')')')

However, you could do the same thing much more easily with the patsubst
macro (if you quote it correctly!).

Cheers,
        Gary.

-- 
Gary V. Vaughan      ())_.  [EMAIL PROTECTED],gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Bug-m4 mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-m4

Reply via email to