Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-lcc!lll-winken!uunet!munnari!vuwcomp!dsiramd!marcamd!aucsv!ok From: ok@aucsv.UUCP (Richard Okeefe) Newsgroups: comp.lang.prolog Subject: Re: Committed Choice Summary: not identical Keywords: cut if-then-else Message-ID: <192@aucsv.UUCP> Date: 30 Mar 89 06:05:54 GMT References: <11500012@hpldola.HP.COM> <733@gould.doc.ic.ac.uk> <18798@adm.BRL.MIL> Organization: Computer Science Dept.,University of Auckland,New Zealand Lines: 24 : In article <8209@russell.STANFORD.EDU> pereira@russell.UUCP (Fernando Pereira) writes: : : repeat, : : { Body } : : ( -> ! : : ; -> fail : : ). In article <18798@adm.BRL.MIL>, broome@adm.BRL.MIL (Paul Broome ) writes: : Here's one alternative I've seen that's only slightly cleaner: Define : repeat(Body, Until) :- : repeat, : Body, : Until, : !. : Then we can accomplish the same thing with : ... : repeat(, ). They don't do the same thing. When we're talking about cuts and repeats, we're in Imperative land. Consider then that the first version calls the body then the exit condition and then the continuation condition. While the second version is missing the body and calls the continuation condition before the exit condition. (Actually, the second version has mixed the body and continuation condition up.)