Re: [eclipse-clp-users] Calling predicates from a module using Java

From: Kish Shen <kish_at_...2...>
Date: Tue, 27 May 2008 22:45:17 +0100
Hi,

Wit Jakuczun wrote:
> Hi,
>    I have a question regarding Java to ECLiPSe interface.
> I have a prolog program that consists of a few modules.
> I would like to be able to call a predicate from a module.
> For this I tried such code:
> 	CompoundTerm ret = engine.rpc( 				
> 		new CompoundTermImpl(":",
> 			"problem",
> 			"test(V)"
> 			)
> 		);
>
> Unfortunately it does not work. I get the following error:
>     type error in type error in is_a_module("problem")
>
>   
You are using Java strings for "problem" and "test(V)". These are mapped 
to ECLiPSe strings -- see the section on the mapping between ECLiPSe and 
Java data types in the Embedding manual. ECLiPSe modules
have to be atoms, not strings -- this is why you are getting the type 
error (and also "test(V)" is a string, and not
the compound term test(V)).

Cheers,

Kish
 
> Of course earlier I have apriopriate
> engine.rpc("use_module(\"problem.ecl\")");
>
> Moreover I can call a predicate from a module using C interface.
>
> I would be grateful for any explanation.
>
> Best regards
> --
> [ Wit Jakuczun w.jakuczun@...116... ]
> [ WLOG Solutions http://wlogsolutions.com   ]
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
>   
Received on Tue May 27 2008 - 14:45:42 CEST

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