Comment 1 for bug 632368

Nikodemus Siivola (nikodemus) wrote :

This is an interesting notion.

Attached diff shows one way to do this: allow IR1-OPTIMIZE to reconstitute source forms for compiler-macros to look at if any of the arguments is a constant.

The same approach could be extended by annotating the lexenv with derived types of arguments, so compiler-macros could benefit from Python's type derivation.

Stuff to do if this is to go in:

* Annotate the lexenv calling the compiler-macro-function.

* Don't do this more than once per combination unless more constants become apparent during optimization.