Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
NextValue Method
SwiPlCs interface ► SbsSW.SwiPlCs ► PlTerm ► NextValue()()()()
return a PlTerm bound to the next element of the list PlTail and advance PlTail.
Returns the element on success or a free PlTerm (Variable) if PlTail represents the empty list.
If PlTail is neither a list nor the empty list, a PlTypeException (type_error) is thrown.


The Next element in the list as a PlTerm which is a variable for the last element or an empty list


public void List_Add_list_doc() { PlTerm t = new PlTerm("[x,y]"); PlTerm l = new PlTerm("[a,b]"); Assert.IsTrue(l.IsList); Assert.IsTrue(l.AddList(t)); Assert.IsTrue(l.IsList); Assert.AreEqual("[a,b,x,y]", l.ToString()); Assert.AreEqual("a", l.NextValue().ToString()); Assert.AreEqual("b", l.NextValue().ToString()); Assert.AreEqual("[x,y]", l.ToString()); }