I have a list that I create as follows:
tab([(top,left),(top,middle),(top,right),(center,left),(center,middle),
(center,right),(bottom,left),(bottom,middle),(bottom,right)]).
I want to create a global variable AllPosition, which is a tab. So I did the following:
tab(AllPos).
Is it correct?
Then I have to keep track of the problem: I have a function that gets one of a pair in a bookmark. I want to delete this. So I did this:
place(Line, Column, Tab) :-
AllPos \== [_,_] -> (member((Line,Column), AllPos) -> (erase(AllPos, (Line,Column), AllPos)).
where it erase(List, Element, NewList)erases the Element from the list and creates a new NewList, equal to List, but without the element. Both functions memberalso erasework.
... , AllPos . , , , ( ), . ? AllPos ?