Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!gem.mps.ohio-state.edu!swrinde!ucsd!ogccse!littlei!omepd!merlyn From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: gnu.emacs Subject: Re: do-while loop in Emacs Lisp? Message-ID: <5179@omepd.UUCP> Date: 12 Nov 89 20:31:00 GMT References: Sender: news@omepd.UUCP Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Distribution: gnu Organization: Stonehenge; netaccess via Intel, Hillsboro, Oregon, USA Lines: 31 In-reply-to: montnaro@sprite.crd.ge.com (Skip Montanaro) In article , montnaro@sprite (Skip Montanaro) writes: | I need a do-while construct in Emacs Lisp. The only thing I can think of is | | (catch 'loop | (while t | | ... loopy stuff here ... | | (if exit-condition-met | (throw 'loop t)))) | | Is that the logical way to do it? As usual, there are probably a zillion ways to do it. One that I like is: (while (progn body-1 body-2 ... body-n test-condition)) Works just fine. Just another Elisp hacker (when I'm not wailing on Perl), -- /== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\ | on contract to Intel's iWarp project, Hillsboro, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn | \== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/