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

Re: Another EQ problem

I had encountered similar problems a long time ago. In fact, 
what's even worse is that the definition of the function/structure
changes if you perform destructive operations. For eg.

(defstruct foo (a '(0.0 0.0)) (b '(0.0 0.0)))

;; compile; then

(setq bar (make-foo))

(setf (nth 0 (foo-a bar)) 4.5)

;; ... etc

;; and then

(setq baz (make-foo))

;; will yeild


;; for 

(nth 0 (foo-a baz))

;; Similar behavior if you modified the lists '(a b c d) in the
;; function with rplaca, for instance. Subsequent calls to the 
;; function use the "new" lists. 

;; Moral of the story, create your lists with "list", etc rather
;; than "hardcoding" them.

				- rajendra