News for hackers. Stuff that matters.
Re:A Road to Lisp: Which Lisp by pooyamo on Saturday July 18, 2026 @04:11AM (#48956134)
The LOOP solution could be written using DOLIST or DO forms too (likewise built-in):

  (defun calculate (instructions)
    (let ((result 0))
      (dolist (e instructions result)
        (destructuring-bind (operator operand) e
          (setf result
                (case operator
                  (add      (+ result operand))
                  (multiply (* result operand))
                  (subtract (- result operand))))))))
  
  (defun calculate (instructions)
    (do ((result 0))
        ((null instructions) result)
      (destructuring-bind (operator operand) (pop instructions)
        (setf result
              (case operator
                (add      (+ result operand))
                (multiply (* result operand))
                (subtract (- result operand)))))))

There are no comments on this comment yet.