Path: utzoo!mnetor!uunet!mcvax!ukc!eagle!icdoc!ivax!cdsm From: cdsm@ivax.doc.ic.ac.uk (Chris Moss) Newsgroups: comp.lang.prolog Subject: Re: A Suggested Additional Predicate for Prolog Message-ID: <237@gould.doc.ic.ac.uk> Date: 22 Mar 88 17:27:02 GMT References: <10303@shemp.CS.UCLA.EDU> Sender: news@doc.ic.ac.uk Reply-To: cdsm@doc.ic.ac.uk (Chris Moss) Organization: Dept. of Computing, Imperial College, London, UK. Lines: 18 In article <10303@shemp.CS.UCLA.EDU> gast@CS.UCLA.EDU () writes: >I suggest that back_retract would be useful for many applications. >(Not mutually exclusive) > +) finding permutations > +) solving constraints etc. David, you need to learn the style of programming in Prolog before you make suggestions as to how to change it. Read one of the better books: e.g. Sterling & Shapiro's "The Art of Prolog". You will find that the use of data structures is almost ALWAYS preferable to using assert and retract. e.g. write a list permutation routine and compare the speed with one using assert and retract (any one, not just yours) -- the better the Prolog the bigger the difference. That's why nobody bothers to improve assert and retract (there are other reasons too). Chris Moss.