Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
NextValue Method
SwiPlCs interfaceSbsSW.SwiPlCsPlTermNextValue()()()()
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.
Declaration Syntax
C#Visual BasicVisual C++F#
public PlTerm NextValue()
Public Function NextValue As PlTerm
public:
PlTerm NextValue()
member NextValue : unit -> PlTerm 
Return Value
PlTerm
The Next element in the list as a PlTerm which is a variable for the last element or an empty list
Examples
 Copy imageCopy
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());
}

Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60601.0 (1.1.60601.0)