Would the following help? Change the sentence, "It shall be an error for a macro to expand directly or indirectly to text containing another usage of itself (a recursive macro)." TO "It shall be an error for the definition of a macro to expand directly or indirectly to text containing another usage of itself (a recursive macro). However, an actual argument to a macro may contain a usage of the same macro. Example:", followed by Greg's example. Thanks, Shalom > > I see an issue with the description of the expansion ordering, with > > respect to the definition of what constitutes a recursive > macro. As > > Greg pointed out, the original example where a `TOP invocation was > > used as an actual argument of a `TOP invocation, is not > recursive. It > > is composition of the macro with itself, not recursion. > The new use > > of the macro is coming from the argument, not from the > macro body. It > > does not create any issues with infinite recursion. But with the > > description of substituting the actuals into the macro text before > > expanding them (though I think that is the right thing to do), the > > macro is expanding into text containing a usage of itself. The LRM > > says that this is erroneous, and a recursive macro. In a > sense, this > > issue was already there, but it has been made more severe > because of > > the explicit description of the expansion order. > > I would have omitted this entirely, except that it gave a way > to pass an empty actual argument to a formal argument with a > non-empty default. I agree that what you say is a problem. > How do YOU reconcile substituting actuals into the macro > before expanding them with the existing LRM statement, "It > shall be an error for a macro to expand directly or > indirectly to text containing another usage of itself" ? > > > > I also have a problem with the statement that the argument > expansion > > shall not introduce new uses of the formal. That wording > implies that > > it is possible but illegal to do this. > > What is intended is that it is not possible to do this, > because text > > that expands into an identifier that matches a formal is not > > considered to be a use of the formal after the actuals have been > > substituted. Just because the word "shall" > > is supposed to be used in some situations does not mean > that it should > > be used in all situations. It has a very specific meaning > in the LRM. > > Well, 'shall' could be understood here as an instruction to > the tool developer, but I agree it is ambiguous. How about, > > "When a macro usage is passed as an actual argument to > another macro, the argument expansion does not introduce new > uses of the formal arguments to the top-level macro." > (or 'will not') ? --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Sun Dec 2 23:48:29 2007
This archive was generated by hypermail 2.1.8 : Sun Dec 02 2007 - 23:48:53 PST