How about: (doseq [i [1 2 3 4] :while (< i 3)] (println i))
Alternatively, if you need some outside state you can: (let [stop-i (atom 3)] (doseq [i [1 2 3 4] :while (< i @stop-i)] (println i))) Rangel @raspasov On Sunday, March 1, 2015 at 2:30:22 AM UTC-8, Cecil Westerhof wrote: > > I have a program where I change a lot of records based on id's in a > sequence. It is a manual process, so I want to give the user an option to > terminate the sequence. What would be the correct way to stop (for example) > a doseq? > > -- > Cecil Westerhof > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.