On first glance, this -
(defun vector (p1 p2)
(mapcar '(lambda (%1 %2) (- %2 %1) ) p1 p2 )
)
Could be written -
(defun vector (p1 p2)
(mapcar '- p2 p1)
)
But at that point, you may as well just write the mapcar function inline.
Also this -
(if lst
(setq lst (cons c lst))
(setq lst (list c))
)
Can be replaced with -
(setq lst (cons c lst))
Since (cons c lst) == (list c) when lst is nil.