1

In C# you can write a while-loop like this

do {
  stuff();
} while (condition)

which means it will first do stuff() once, and only then start checking the condition for additional runs.

Is there an equivalent pattern in Emacs Lisp?

1

2 Answers 2

2
(while (progn
         (stuff)
         (condition)))
0
0

The other answer by phils is probably best. For completeness' sake, here's another pattern.

(let ((more t))
  (while more
    (stuff)
    (setq more (condition))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.