Re: [eclipse-clp-users] ec_external definition not included if EC_EMBED is defined.

From: Joachim Schimpf <jschimpf_at_coninfer.com>
Date: Tue, 04 Dec 2012 17:36:46 +0100
Hi Oreste,

On 27/11/2012 19:40, Oreste wrote:
> Hi,
> I am working on external predicates implemented in C.
> I have just seen that int ec_external(dident pred, int(*fct)(), dident
> module) definition is not included if EC_EMBED is defined.
> See embed.h.

The ec_external() function is intended to be part of the
"embedding interface", as documented.  The declaration in the
include file was in the wrong place - I've fixed this now.


On 30/11/2012 21:51, Oreste wrote:
> Beside this issue I have another issue.
> In Python, functions are defined at execution time (function are
> converted in bytecode at runtime) and python functions are not mapped to
> c functions that I can register to Eclipse.
> So I have a c proxy function registered as call_python/2. First argument
> shall be atom matching the name of python function and the second
> argument is a list that I pass to the python function .
> This is not a ideal implementation.
> My preferred solution would be:
> register all  predicates (to be linked to python functions) to the same
> c function. In this c function I get the functor of invoking predicate
> e.g. ec_functor() then I can search in a python hash table the right
> python function and call it using c to python interface functions.
>
> I don't expect that my use case justifies an effort in this direction by
> if you have the opportunity.... :-).

Yes, that could be done, probably even with no overhead.
I'll check and get back to you on that one.


-- Joachim
Received on Tue Dec 04 2012 - 17:04:03 CET

This archive was generated by hypermail 2.2.0 : Wed Dec 05 2012 - 06:13:35 CET