🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #4237

Re: Re: loops in prolog

#4237
From: #Stefan Bachert
Date: Thu, 01 Mar 1990 11:19
21 lines
954 bytes
Hello,

you are right. A cut before action_3 will clarify the situation.
I am not sure that you get me right with the idea of 
once_true. So I repeat it here

	once_true(X):-call(X),!.	% predicate X is determinated
	once_true(_).			% and always true

	loop:-
		repeat,
		once_true(action_1),
		(not condition;once_true(action_2),fail),!,
		once_true(action_3).

You proposal will still eat up the stack. I think the basenote
author has to judge what proposal fit for his problem.

Stefan Bachert

PS: I don't like ->/2 because of its dubious definition.
Technical Details
Message-ID: <470003@hpbbi4.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-ses!hpbbn!hpbbi4!stefan
References: <1032@fs1.ee.ubc.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-ses!hpbbn!hpbbi4!stefan
From: stefan@hpbbi4.HP.COM (#Stefan Bachert)
Newsgroups: comp.lang.prolog
Subject: Re: Re: loops in prolog
Message-ID: <470003@hpbbi4.HP.COM>
Date: 1 Mar 90 11:19:31 GMT
References: <1032@fs1.ee.ubc.ca>
Organization: Hewlett-Packard GmbH
Lines: 21