Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ncar!tank!uxc!uxc.cso.uiuc.edu!clio!gerdeman From: gerdeman@clio.las.uiuc.edu Newsgroups: comp.lang.prolog Subject: Copying Message-ID: <16400001@clio> Date: 19 Oct 88 16:45:00 GMT Lines: 14 Nf-ID: #N:clio:16400001:000:508 Nf-From: clio.las.uiuc.edu!gerdeman Oct 19 11:45:00 1988 Sterling and Shapiro give the following procedure for copying: copy(X,Y):- assert('$foo'(X)),retract('$foo'(Y)). I have found the following to be much faster: copy(X,Y):- findall(Z, Z = X,[Y]). This only works with findall not setof or bagof. Can anyone explain why this works? In general, I have discovered, destructive variable bindings embedded within findall have no global effect. Again this is not the case with setof and bagof. Very peculiar isn't it? --- Dale Gerdemann