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++ | F# |
public static PlTerm PlTail( PlTerm list )
Public Shared Function PlTail ( list As PlTerm ) As PlTerm
public: static PlTerm PlTail( PlTerm list )
static member PlTail : list : PlTerm -> PlTerm
Parameters
- list (PlTerm)
- The initial PlTerm
Return Value
PlTerm
A PlTerm for which is_list/1 succeed.
A PlTerm for which is_list/1 succeed.
Examples
Copy | |
---|---|
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.dll) Version: 1.1.60601.0 (1.1.60601.0)