What is the difference between the following solutions (a setf function and a function)? Is one of them preferable, or are they only two ways to get the same result?
(defparameter *some-array* (make-array 10)) (defun (setf arr-index) (new-value index-string) (setf (aref *some-array* (parse-integer index-string)) new-value)) (defun arr-index-1 (index-string new-value ) (setf (aref *some-array* (parse-integer index-string)) new-value)) CL-USER> *some-array* #(0 0 0 0 0 0 0 0 0 0) CL-USER> (setf (arr-index "2") 7) 7 CL-USER> (arr-index-1 "3" 5) 5 CL-USER> *some-array* #(0 0 7 5 0 0 0 0 0 0) Thank you for your answers.