Subject: Re: [SWIPL] biginer's question.

From: Prasad Manjre <[email-masked]>
Date: Mon, 26 Mar 2001 10:32:04 +0530 (IST)

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 <[email-masked]> 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