Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!rpi!leah!bingvaxu!vu0310 From: vu0310@bingvaxu.cc.binghamton.edu (R. Kym Horsell) Newsgroups: comp.lang.prolog Subject: Re: Arrays in Prolog Message-ID: <3904@bingvaxu.cc.binghamton.edu> Date: 28 Aug 90 19:24:52 GMT References: <90239.175243SCHMIED@DB0TUI11.BITNET> <3899@bingvaxu.cc.binghamton.edu> <1990Aug28.065353.13951@sics.se> Reply-To: vu0310@bingvaxu.cc.binghamton.edu.cc.binghamton.edu (R. Kym Horsell) Organization: SUNY Binghamton, NY Lines: 26 In article <1990Aug28.065353.13951@sics.se> roland@sics.se (Roland Karlsson) writes: \\\ >> allows backtracking so that ``term'' may be restored to its >> former state -- no destructuve assignment happens unless you >> setarg(X,Y,Z), !. > >Setarg/3 is implemented in SICStus Prolog. But 'setarg,!' will NOT >lead to a destructive assignment. The correct value is reinstalled >att backtracking. I would consider it a bug if it did so. I *realize* setarg/3 is implemented in Sicstus and elsewhere -- I wasn't trying to claim anything particularly original. My comment about ``destructive'' assignment was meant to imply that the assignment was not really permanent -- it was *normally* undone on backtracking -- unless a ! was subsequently specified (I try to keep away from terms like ``executed'' and ``performed'' in preparation for the day we *really* have logic programming -- or maybe this is a perfect reason for doing the opposite)?. I was, however, under the impression that setarg/3 in Sicstus (and certainly in my current compiler) edited the actual heap structure that represented the PROLOG term. Why do you consider it a bug if ``setarg(X,Y,Z),!'' DOES NOT remove the backtrack point that restores the structure ``Y''? -Kym Horsell