public override object CallPrologFast(object[] paramz) { PrologCLR.RegisterCurrentThread(); var results = paramz; PlTerm plC = PlTerm.PlVar(); libpl.PL_recorded(closureTerm, plC.TermRef); PlTerm ctestVars = plC.Arg(0); PlTerm ctestCode = plC.Arg(1); PlTerm[] terms = PrologCLR.ToTermArray(ctestVars); int idx = terms.Length - 1; int resdex = results.Length - 1;; while (idx >= 0 && resdex >= 0) { terms[idx--].FromObject(results[resdex--]); } PrologCLR.PlCall("user", "call", new PlTermV(ctestCode, 1)); return(null); }