Re: [eclipse-users] C++/C and variables

From: Joachim Schimpf <js10_at_crosscoreop.com>
Date: Tue, 21 Nov 2006 14:23:07 +0000
schugk_at_rz.uni-potsdam.de wrote:
> Hi,
> I wrote a short program in order to show you my problem. 
> 
> #include <eclipseclass.h>
> int main()
> {
>   ec_init();
> 
>   post_goal("compile_term(a(X):- X = [A,A,B])");
>   EC_resume();
> 
>   EC_ref X;
>   EC_functor a("a",1);
>   post_goal(term(a,X));
>   EC_resume();
> 
>   { .... parsing X .... }
> 
>   ec_cleanup();
>   return 0;
> }
> 
> After the goal a(X) was processed the reference X points to a list
> of 3 variables. How can i retrieve identifiers like _887 or _A from
> unreferenced variables? I don't want to use 'ec_exec_string' and
> 'ec_var_lookup'. Any solution in C or C++ would be very helpful. 

Such "identifiers" are useless for programming purposes, they are
only used in a textual representation to indicate sharing.

Best advice: C++ does not have the concept of logical variable.
Therefore, do all processing involving logical variables on the
ECLiPSe side of your code, and pass only simple data types
(integers, strings, etc) through the ECLiPSe/C++ interface.
You will save yourself a lot of work.

-- Joachim
Received on Tue Nov 21 2006 - 14:23:35 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:57 CET