Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
Append Method (term)
SwiPlCs interface ► SbsSW.SwiPlCs ► PlTerm ► Append(PlTerm)
Appends element to the list and make the PlTail reference point to the new variable tail.
If A is a variable, and this method is called on it using the argument "gnat",
a list of the form [gnat|B] is created and the PlTail object now points to the new variable B.
This method returns TRUE if the unification succeeded and FALSE otherwise. No exceptions are generated.


- term (PlTerm)
- The PlTerm to append on the list.

true if successful otherwise false


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