Since a few weeks, I realize that I have troubles with a specific construct regarding type specifiers. First of all, I am using SBCL 2.1.9, compiled from source, which "apparently passes all the tests".
Here is the problem: when I try to specify a type for a function using this form
(declaim (ftype (function (*) int) foo))
here is what SBCL tells me
debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "main thread" RUNNING {1001870303}>:
* is not permitted as an argument to the FUNCTION type specifier
It could very well be completely normal if not for a few reasons:
- When using the exact same form on another machine with SBCL 2.1.8, this form is perfectly valid
- The spec does not seem to forbid such a construct, although it is very hard to tell. For example, there is a bunch of code in the sb-kernel, namely the
types.lispfile (entirely written in theSB-KERNELpackage), which is dedicated to catch invalid * symbols in type specifiers. Without reading in details those functions, it is hard to tell whether this is normal or not. - Many people, with much, much experience than I have, use this construct in their projects. It has caused me a lot of trouble when trying to compile them by hand recently, as SBCL would not let me compile those forms. For example, I opened an issue for the Nyxt browser regarding this very problem, and I still have trouble compiling the game engine cl-bodge which has been successfully used to make quite a large number of games (and so, such bugs should have been long gone by now)
And so, I have a few questions:
- Once and for all, is the problematic form valid Common Lisp or not ?
- If it is not, why do so many people, including some of the most knowledgeable persons about CL, use it (seemingly without any problem) ?
- If it is (and I am pretty sure it is), is there any reason why I observe this behaviour, even after recompiling SBCL and passing all the tests ?
- Do you have any idea on how I could fix this, so I no longer have to manually rewrite all the ftype declarations of this form as
(ftype (function (t) bar)foo) in all the libraries that I try to compile ?
Thanks in advance !