sionescu/static-vectors — pull request #1 by rpav (2012-10-18 17:23:18+00:00)
Title: Compiler macro fixes

Apparently the `CONSTANTP` branch of the `MAKE-STATIC-VECTOR` never triggers, because `ELEMENT-TYPE` is evaluated too early. Thus the function is always called.

This fix moves the evaluation to SBCL's compiler-macro for `%ALLOCATE-STATIC-VECTOR` and to the compiler macro for `%INITIALIZE-STATIC-VECTOR`. (Any sooner, and the macros would also fail the constant check.) SBCL appears to be the only implementation with a compiler macro for allocation, so no other implementations seem to need alteration.

This also removes the `SYMBOL-MACROLET` for implicitly passing element type and length (which will also fail the constant check) to `%INITIALIZE-STATIC-VECTOR`. These are now explicitly passed by both the function and the macro. I have verified that the constant expansion now happens in both cases.

I have tested this with SBCL-1.1.0 and CCL-1.7, both trivially and running the included FiveAM tests. The test results are the same as `v1.4` in both cases, and SBCL even has fewer notes!