Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!decwrl!ucbvax!bloom-beacon!eru!hagbard!luth!sunic!sics.se!sics.se!roland From: roland@sics.se (Roland Karlsson) Newsgroups: comp.lang.prolog Subject: Re: Arrays in Prolog Message-ID: <1990Aug29.095308.18522@sics.se> Date: 29 Aug 90 09:53:08 GMT References: <90239.175243SCHMIED@DB0TUI11.BITNET> <3899@bingvaxu.cc.binghamton.edu> <1990Aug28.065353.13951@sics.se> <3904@bingvaxu.cc.binghamton.edu> Sender: news@sics.se Organization: Swedish Institute of Computer Science, Kista Lines: 17 In-Reply-To: vu0310@bingvaxu.cc.binghamton.edu's message of 28 Aug 90 19:24:52 GMT OK Kym. I am lost. I do not understand what you mean by ! making the destructive change made by setarg permanent. This is how it works in SICStus though. When doing a setarg you will first save code on heap that will restore the old value at backtracking. Then you put a pointer on trail that refers to this code. Then you do the change. Neither the heap or the trail will be effected at !. So at backtracking (untrailing) you will trap at the pointer to the heap. The code on the heap will be executed and thereby the old value restored. So a ! will NOT make the change permanent. -- Roland Karlsson SICS, PO Box 1263, S-164 28 KISTA, SWEDEN Internet: roland@sics.se Tel: +46 8 752 15 40 Ttx: 812 61 54 SICS S Fax: +46 8 751 72 30