Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!agate!labrea!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: The double-cut. Message-ID: <211@quintus.UUCP> Date: 30 Jul 88 04:52:43 GMT References: <1162@ttds.UUCP> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 15 In article <1162@ttds.UUCP> jonasn@ttds.UUCP (Jonas Nygren) writes: >When trying to write procedural code for a simple curvplotting routine >I often encountered problems with backtracking over system-calls. The >remedy for this was code like: > a :- !, b, !, c, !, d, !, e, !. >to avoid backtracking of goals a,b,c,d,e but this looks rather awkward. Forgive me, but I cannot imagine this cropping up. Why do you WANT to prevent backtracking over system-calls? You can backtrack over read/1, write/1, var/1, assert/1 &c all you like, it doesn't hurt. As a general rule, code with side-effects should be determinate, so backtracking over it will do nothing at all. (retract/1 is an exception, but I doubt that anyone would commend as an example to follow.) Please let's see a real example of where you think you need to do this.