[Openmcl-devel] Compiler infinite loop

Tim Bradshaw tfb at tfeb.org
Mon Sep 20 03:16:12 PDT 2010

On 20 Sep 2010, at 10:04, Pascal J. Bourguignon wrote:

> Symbol macrolets don't take a parameter.  Their expansions are constant.

No, they're not.  They may depend on things which are not parameters to the macro, such as variables defined at expansion-time or other things.  So in order to detect such a loop you'd both need to do an occurs check (which would tell you if you'd seem this symbol before while expanding) *and* be able to know that the expansion of the macro was in fact constant.  That's obviously not soluble in general though it probably is in almost all interesting cases as I imagine that the non-constant ones are rare to the point of non-existance.

Still, this seems like a heroic thing for a system to do, still less be required to do.

It's easy to concoct other examples of where macros can cause compilers to loop, of course.

More information about the Openmcl-devel mailing list