[Top][All Lists]

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

An m4 puzzlement.

From: R. Clayton
Subject: An m4 puzzlement.
Date: Wed, 14 Dec 2011 05:43:22 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

I'm running 

  $ m4 --version
  m4 (GNU M4) 1.4.16
  Copyright (C) 2011 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

  Written by Rene' Seindal.



  $ cat /proc/version
  Linux version 3.1.0-1-686-pae (Debian 3.1.1-1) (address@hidden) (gcc
  version 4.6.2 (Debian 4.6.2-4) ) #1 SMP Mon Nov 14 08:24:20 UTC 2011


and I'm not understanding why this

  $ cat t
    `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


How is it that _itlvar works correctly on the first argument to subsen but not
the second (apart from accidentally)?

I know there needs to be more quoting to deal with arguments containing commas,
but let's assume my question is dealing with exactly and only the example

reply via email to

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