Consider the following function:
(defun afunction (a) (declare (type (simple-array double-float (*)) a)) a)
It compiles fine in cl-user, but if I'm in antik-user, I get:
; in: DEFUN AFUNCTION ; (TYPE (SIMPLE-ARRAY DOUBLE-FLOAT (ANTIK:*)) ANTIK:A) ; ; caught ERROR: ; bad dimension in array type: * ; ; compilation unit finished ; caught 1 ERROR condition
So, the antik definition of * breaks declarations that use *.
Any way to fix this?
Thanks, Harvey
On May 17, 2015 9:55 PM, "Harvey Stein" hjstein@gmail.com wrote:
Consider the following function:
(defun afunction (a) (declare (type (simple-array double-float (*)) a)) a)
It compiles fine in cl-user, but if I'm in antik-user, I get:
; in: DEFUN AFUNCTION ; (TYPE (SIMPLE-ARRAY DOUBLE-FLOAT (ANTIK:*)) ANTIK:A) ; ; caught ERROR: ; bad dimension in array type: * ; ; compilation unit finished ; caught 1 ERROR condition
So, the antik definition of * breaks declarations that use *.
Any way to fix this?
You have several options. Antik shadows '* (along with other mathematical symbols) and an unfortunate side effect is that it affects other uses of the symbol '* in cl. So, you can just use cl:* (i.e., put the explicit prefix in). That should always work. There is a symbol macro that defines 'antik:@ to cl:*, so using @ should work. I'm not sure if there's a way to unshadow a symbol, but you can do something like
(setf antik::*antik-user-shadow-symbols* (remove '#:* antik::*antik-user-shadow-symbols*))
and then make a new package using antik:make-user-package, which will have all the use-package and shadowed symbols except *. If you do this, be careful to use antik:* everywhere you mean Antik's multiply, otherwise it will assume cl:*.
Liam
Thanks, Harvey
-- Harvey J. Stein hjstein@gmail.com http://www.linkedin.com/in/harveyjstein Selected papers and presentations available at: