[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

redefinition problem



This seems like the kind of problem which should have already been
reported if it really is a bug, but I haven't found mention of it
anywhere. It goes like this:

If I mistakenly define point:

(defclass point ()
	((xcoord :initform 0 :type string)
	 (ycoord :initform 0 :type string))
	(:accessor-prefix pos- )
	(:documentation "Points on a cartesian plane.")
  )

so that the slots are typed as string instead of number then, after I do,

(setq foo (make-instance 'point))

I find that

(setf (pos-xcoord foo) 99)

fails, but 

(setf (pos-xcoord foo) "99")

succeeds. No surprises. But once I retype the declass expression,

(defclass point ()
	((xcoord :initform 0 :type number)
	 (ycoord :initform 0 :type number))
	(:accessor-prefix pos- )
	(:documentation "Points on a cartesian plane.")
  )

AND REDO THE SETQ FOO

(setq foo (make-instance 'point))


I still find that 

(setf (pos-xcoord foo) 99)

fails because "99 is not of type STRING".