- Code: Select all
(psetf (point-x p) (point-y p)
(point-y p) (point-x p))
If not, you may need to use an explicit temporary variable. Something like
- Code: Select all
(let ((x (point-x p)))
(setf (point-x p) (point-y p)
(point-y p) x))
(psetf (point-x p) (point-y p)
(point-y p) (point-x p))(let ((x (point-x p)))
(setf (point-x p) (point-y p)
(point-y p) x))(defmacro swap (place1 place2)
`(setf ,place1 (prog1 ,place2 (setf ,place2 ,place1))))(setf (point-x p) (prog1 (point-y p) (setf (point-y p) (point-x p))))Users browsing this forum: Google [Bot] and 1 guest