Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
PlTail Method (list)
SwiPlCs interface ► SbsSW.SwiPlCs ► PlTerm ► PlTail(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.


- list (PlTerm)
- The initial PlTerm

A PlTerm for which is_list/1 succeed.


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()); }