From h2000500@bits-pilani.ac.in Mon Mar 26 07:04:51 2001
Received: from asura.bits-pilani.ac.in (IDENT:root@[202.54.26.114])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f2Q54j325851
	for <prolog@swi.psy.uva.nl>; Mon, 26 Mar 2001 07:04:48 +0200 (MET DST)
Received: from ipc.bits-pilani.ac.in (ipc.bits-pilani.ac.in [192.168.1.211])
	by asura.bits-pilani.ac.in (8.9.3/8.9.3) with SMTP id KAA00910;
	Mon, 26 Mar 2001 10:39:42 +0530
Date: Mon, 26 Mar 2001 10:32:04 +0530 (IST)
From: Prasad Manjre <h2000500@bits-pilani.ac.in>
To: "Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
cc: prolog@swi.psy.uva.nl
Subject: Re:  [SWIPL] biginer's question.
In-Reply-To: <200103190051.MAA10935@atlas.otago.ac.nz>
Message-ID: <Pine.SCO.3.96.1010326102233.8820A-100000@ipc.bits-pilani.ac.in>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Thanks for your guidance, 
 As you have quoted in your example,I created another list & stored the
rest of list into that i.e 
                X1= ([1,3,4])
 But while using this list in the another loop,as soon as the control
moves to that list the compiler treats X1 as new variable & the values
stored in it in the previous loop gets lost.& the compiler treats this X1
as the empty list.
 So will you guide me to use the contets stored in the list X1 to use it
for the another loop?
Thanking you.
-------------------------------------------------------------------------------
 On Mon, 19 Mar 2001, Richard
A. O'Keefe wrote:

> Prasad Manjre <h2000500@bits-pilani.ac.in> wrote:
> 
>     we can delete the contents of the list. ok. But can we use that deleted
>     list again in the program? or rather in the other loop of the same
>     program?
> 	
> Which list?  Represented how?  What do you mean by "delete"?
> 
> If you represent Prolog data as terms (node-labelled trees with holes)
> then you can fill in the holes, but you cannot change things.
> In particular, if
> 	X = [1,2,3,4]
> and you want to remove 2 from X, you *CAN'T*.  All you can do is
> create *another* list
> 	select(2, X, X1)
> =>	X1 = [1,3,4]
> but X still has its original value and can be used any way you want.
> 
> If you represent data as facts in the data base, then you are back in
> the sublunar world of change and decay.  (Well, maybe not decay.)
> 
> 

Prasad










