m4-patches
[Top][All Lists]
Advanced

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

Re: 13-m4-undivert-culprit.patch


From: Akim Demaille
Subject: Re: 13-m4-undivert-culprit.patch
Date: 20 Aug 2001 18:08:43 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

-    for (i = 1; i < argc; i++)
-      {
-       if (sscanf (M4ARG (i), "%d", &file) == 1)
-         m4_insert_diversion (file);
-       else if (no_gnu_extensions)
-         M4ERROR ((warning_status, 0,
-                   _("Non-numeric argument to %s"),
-                   M4_TOKEN_DATA_TEXT (argv[0])));
-       else
-         {
-           fp = m4_path_search (M4ARG (i), (char **)NULL);
-           if (fp != NULL)
-             {
-               m4_insert_file (fp);
-               fclose (fp);
-             }
-           else
-             M4ERROR ((warning_status, errno,
-                       _("Cannot undivert %s"), M4ARG (i)));
-         }
-      }
+    {
+      if (sscanf (M4ARG (1), "%d", &i) == 1)
+       m4_insert_diversion (i);
+      else if (no_gnu_extensions)
+       m4_numeric_arg (argv[0], M4ARG (1), &i);
+      else
+       {
+         FILE *fp = m4_path_search (M4ARG (1), (char **) NULL);
+         if (fp != NULL)
+           {
+             m4_insert_file (fp);
+             fclose (fp);
+           }
+         else
+           M4ERROR ((warning_status, errno,
+                     _("Cannot undivert %s"), M4ARG (1)));
+       }
+    }

I understand this can be unwelcome, please tell me.  But my experience
with Autoconf gave me some simple rules, and one of the main
conclusion is really `never compromise useful future extension of
macro when it can be done straightforwardly with existing macros'.

And the 1-ary -> n-ary as a simple for-loop extension is the most
attractive of these, IMHO, extremely useless extensions.  Beware of
the dark side.



reply via email to

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