users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to print a prolog Term?


From: Erick Alphonse
Subject: Re: How to print a prolog Term?
Date: Tue, 25 Nov 2003 16:07:20 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031015

Hello,

I am using the C interface, and I don`t know how to print a prolog term that is a variable.

void WritePlTerm(PlTerm t) {
if (Blt_Var(t)) {
   printf ("Var: %i",Rd_Code(t));
}

This prints me the code assigned to the variable, but I`m attempting to write the name of the variable.

Try something like that :

void WritePlTerm(PlTerm t) {
  Pl_Query_Begin(true);
  Pl_Query_Call(Find_Atom("writeq"),1,&t);
  Pl_Query_End(PL_RECOVER);
}

Cheers,
Erick.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]