Re: An m4 puzzlement.

"Gary V. Vaughan" <[email protected]>
Newsgroups gmane.comp.gnu.m4.general
Message-ID <[email protected]>
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)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.