Re: [eclipse-users] more questions although there are no replies :(

From: Joachim Schimpf <js10_at_...2...>
Date: Fri, 03 Nov 2006 11:30:24 +0000
J. Manuel Velasco wrote:
> ...
> post_goal(term(EC_functor("es_hermano",2), "daniel", Result));

This is equivalent to the query

?- es_hermano("daniel", Result).

which fails because daniel \= "daniel" (one is an atom,
the other one a string type).  You'd have to write instead

post_goal(term(EC_functor("es_hermano",2), EC_atom("daniel"), Result));



>  {
>   long i;
>   if (EC_word(Result).is_long(&i) == EC_succeed)
>      cout << i << "\n";
>   else
>      cout << "unexpected result type";
>  }

Because you are now expecting Result to be an atom,
you have to change this code accordingly, e.g.

  {
   EC_atom a;
   if (EC_word(Result).is_atom(&a) == EC_succeed)
      cout << a.name() << "\n";
   else
      cout << "unexpected result type";
  }



-- Joachim
Received on Fri Nov 03 2006 - 11:30:33 CET

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST