NextValue Method

SWI-Prolog SbsSW.SwiPlCs

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 Basic Visual C++
public PlTerm NextValue()
Public Function NextValue As PlTerm
public:
PlTerm NextValue()
Return Value
The Next element in the list as a PlTerm which is a variable for the last element or an empty list
Examples
CopyC#
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) Version: 1.1.60301.0 (1.1.60301.0)