Hi,
I'm trying to optimize a piece of CL code (in SBCL) by adding some type declarations. The thing is that I have a class:
Does someone know if there is a way to declare the type of a slot or accessor (something similar to ftype) to optimize arithmetic operations in SBCL when dealing with CLOS objects?
Luis.
I'm trying to optimize a piece of CL code (in SBCL) by adding some type declarations. The thing is that I have a class:
(defclass foo ()
...
(data :accessor data
:type 'single-float))
An I have a method:(defmethod do-something((object foo) a)
(declare (optimize (speed 3))
(single-float a))
( / (data object) a))
I think that SBCL ignores "type" when defining atributes in classes and, indeed, the compiler complains about type uncertainty in the division first argument.Does someone know if there is a way to declare the type of a slot or accessor (something similar to ftype) to optimize arithmetic operations in SBCL when dealing with CLOS objects?
Luis.