Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
DelegateParameter1 Delegate
SwiPlCs interfaceSbsSW.SwiPlCs.CallbackDelegateParameter1

Provide a predefined Delegate to register a C# method to be called from SWI-Prolog

Declaration Syntax
C#Visual BasicVisual C++F#
public delegate bool DelegateParameter1(
	PlTerm term
)
Public Delegate Function DelegateParameter1 ( 
	term As PlTerm
) As Boolean
public delegate bool DelegateParameter1(
	PlTerm term
)
type DelegateParameter1 = 
    delegate of 
        term : PlTerm -> bool
Parameters
term (PlTerm)
Return Value
Boolean
true for succeeding otherwise false for fail
Examples

See also the example in DelegateParameter2.

 Copy imageCopy
[TestMethod]
public void t_creating_a_list()
{
    Delegate d = new DelegateParameter1(create_list);
    PlEngine.RegisterForeign(d);
    for (int i = 1; i < 10; i++)
    {
        PlTerm t = PlQuery.PlCallQuery("create_list(L)");
        Assert.AreEqual("[a,b,c]", t.ToString(), "create_list failed!");
    }
}
public static bool create_list(PlTerm list)
{
    return list.Unify(new PlTerm("[a,b,c]"));
}
See Also

Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60601.0 (1.1.60601.0)