PlTail Method (list)

SWI-Prolog SbsSW.SwiPlCs

Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog PlTail Method (list)
SwiPlCs interfaceSbsSW.SwiPlCsPlTermPlTail(PlTerm)

PlTail is for analysing and constructing lists. It is called PlTail as enumeration-steps make the term-reference follow the `tail' of the list.

A PlTail is created by making a new term-reference pointing to the same object. As PlTail is used to enumerate or build a Prolog list, the initial list term-reference keeps pointing to the head of the list.

Declaration Syntax
C# Visual Basic Visual C++
public static PlTerm PlTail(
	PlTerm list
)
Public Shared Function PlTail ( _
	list As PlTerm _
) As PlTerm
public:
static PlTerm PlTail(
	PlTerm list
)
Parameters
list (PlTerm)
The initial PlTerm
Return Value
A PlTerm for which is_list/1 succeed.
Examples
CopyC#
public void List_Append()
{
    PlTerm t = PlTerm.PlVar();
    PlTerm l = PlTerm.PlTail(t);

    Assert.IsTrue(l.Append(new PlTerm("one")), "append one");
    Assert.IsTrue(l.Append(new PlTerm("two")), "append two");
    Assert.IsTrue(l.Append(new PlTerm("three")), "append three");

    Assert.AreEqual(1, l.Close());

    Assert.AreEqual(3, list_length(t));
    Assert.AreEqual("[one,two,three]", t.ToString());
}

Assembly: SwiPlCs (Module: SwiPlCs) Version: 1.1.60301.0 (1.1.60301.0)