Comment 8 for bug 722552

Revision history for this message
Gustavo (gugamilare) wrote :

I've been trying to implement this in the last couple of days and I've run into many different problems.

It turns out that the compiler does a lot of optimizations based on the function CONSTANTP. Even small modifications in it may break something somewhere else.

As for (constantp '(values 'x 'y)), attempting to make it return T causes bug 938404. IMO this is a bug in SBCL, someone used the function CONSTANTP without considering that it could return T to a form that returns multiple values.

A better implementation of CONSTANTP is essential, not only it would allow SBCL to make certain optimizations that it currently it does not but also the current implementation is unoptimized (it's time complexity is exponential for no reason at all).

I'll be sending a patch that deals with the time complexity (maybe today or tomorrow) and then maybe I'll take a look at implementing support for LET and LET*. Unless it breaks something somewhere :)