Sort 3 numbers in Common Lisp with the minimum number of operations
It does seem to be correct. As for elegance, I believe it can be expressed without nested conditionals and I would consider that more elegant, even if it takes the average number of comparisons from 2.5 to 3. This code does 3 comparisons (always) and up to six writes. Your code does 2 or 3 comparisons and up to seven writes (ignoring temps, that would take the code below to "up to nine" and your code to "up to ten").

On the balance, your code probably has a slight edge in performance, so if this would be a frequently-called function, I would consider using order over order3.

That is:

(defun order3 (min mid max)
  (when (&lt; max min)
     (rotatef max min))
  (when (&lt; mid min)
     (rotatef mid min))
  (when (&lt; max mid)
     (rotatef max mid))
  (list min mid max))