I am new to prolog , I have a list in prolog like A=[1,2,3,4]
, and than I accessed nth element using nth(N,[_|T],R)
. Now I have Nth element in R
, than I have done some calculation on R
. Now what I want is to update that nth element in list.
Because of I am doing a lot of calculations with each element in list I can't make a new list each time.
I didn't find any method to update list.