[eclipse-clp-users] Problem with embedding into TCL/TK

From: Michael Maisuradze <mixo96_at_...423...>
Date: Wed, 23 May 2018 15:53:28 +0000 (UTC)
 
Hello,
I am working on a project that is mainly built with eclipse prolog.
Evidently for some part of our project I needed to implement graphical interface, and started to try with TCL/TK.

My objective is to call certain prolog predicates from the Graphical Interface, and then receive the output in TCL/TK in a manner that I would be able to structure and display the output as an organized table. So far what I could do is to just redirect the output of prolog to the TCL/TK program window frame.  As I read in eclipse documentation: Communication via Queues   
5.5.1  From-ECLiPSe to Tcl
EXDR (ECLiPSe external data representation, see section 5.8) format for communication. This allows to send and receive structured and typed data
To get structured data from eclipse to TCL I did as described in the Manual.

In TCL:
set my_in_channel  [ec_queue_create my_out_queue fromec]set result  [ec_read_exdr $my_in_channel] 
In Eclipse:write_exdr(my_out_queue,  [FSPA, SSPA, TSPA,FPPA,SPPA,TPPA] ),
flush(my_out_queue).
What I wanted to get was the result variable in TCL with the list of a data provided from prolog output. And this should have worked according to embedding manual. Unfortunately I get an error  Error in startup script: conversion error while reading exdr format    while executing"ec_read_exdr $my_in_channel"   

When I tried the exact same example described in manual:
ECLiPSe:        write_exdr(my_out_queue, foo(bar,3)),
                flush(my_out_queue).
         
Tcl:            set result [ec_read_exdr $my_in_channel]

The tcl result should have been {foo bar 3}.But I get the same error.

How Could I receive desired list in a Tcl Variable?
Thanks in advance
Sincerely,
M.Maisuradze

    
Received on Wed May 23 2018 - 16:34:10 CEST

This archive was generated by hypermail 2.3.0 : Thu Feb 22 2024 - 18:13:20 CET