Re: iterating over arguments

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 9/11/2009 8:40 PM:
> This assumes that your arguments to CL_CLISP_REQUIRE_FEATURE won't cause
> further macro expansion or quote removal; to be safer, you'd have to use
> m4_defn([cl_feat]) rather than cl_feat in several places.  Also, if you
> are requiring newer autoconf, it may be more efficient to use
> m4_map_args_w rather than m4_foreach_w:
> 
> m4_define([_CL_CLISP_REQUIRE_FEATURE_1],
> [_CL_CLISP_REQUIRE_FEATURE_2([$1], m4_toupper([$1]))])
> m4_define([_CL_CLISP_REQUIRE_FEATURE_2],
> [AC_CACHE_CHECK([for $2 in CLISP], [cl_cv_clisp_$1],
>   [CLISP_SET([cl_cv_clisp_$1], [[#+$1 "yes" #-$1 "no"]])])
> test $cl_cv_clisp_$1 = no && AC_MSG_ERROR([$2 is missing in CLISP])])
> AC_DEFUN([CL_LISP_REQUIRE_FEATURE],
> [m4_map_args_w([$1], [_CL_CLISP_REQUIRE_FEATURE_1(], [)], [
> ])

I haven't seen any mention of you trying this variant; it still uses
m4_toupper, but avoids m4_pushdef of a temporary macro name, and so it may
react better to the fact that m4_toupper does not quote its argument.  At
any rate, using 'autoconf --trace=_CL_CLISP_REQUIRE_FEATURE_2' would show
what the result of m4_toupper turns out to be in this case.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@xxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkquN5EACgkQ84KuGfSFAYB6KgCguBUQeBpNn6ZefdzmduLQAHLE
YZkAoLhWYDB6LGBJcr/pV3LbM9SWx+0h
=2jZ3
-----END PGP SIGNATURE-----


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux