[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: An m4 puzzlement.
From: |
Gary V. Vaughan |
Subject: |
Re: An m4 puzzlement. |
Date: |
Wed, 14 Dec 2011 22:49:24 +0700 |
Hi R.
On 14 Dec 2011, at 17:43, R. Clayton wrote:
> I'm not understanding why this
>
> $ cat t
> m4_define(_itlvar,
> `m4_ifelse(m4_regexp($1, ^[[:alpha:]]*$), -1, $1, itl($1))')
>
> m4_define(subsen, `_itlvar($1) \(\sqsubseteq\) _itlvar($2)')
>
> subsen(a, b)
> subsen(a, bld(b))
> subsen(bld(a), b)
>
> $
>
> produces this
>
> $ m4 -P < t
>
>
>
>
> itl(a) \(\sqsubseteq\) b
> itl(a) \(\sqsubseteq\) bld(b)
> bld(a) \(\sqsubseteq\) b
M4 1.4 does not support ERE expressions, so [[:alpha:]]* is read as
zero or more characters from the set `[:alph]'. I didn't check
whether your quoting is correct, but you should have more luck with
`^[a-zA-Z]*$'.
Cheers,
--
Gary V. Vaughan (gary AT gnu DOT org)