[eclipse-clp-users] Accessing Eclipse predicates

From: Volkan Unsal <spocksplanet_at_gmail.com>
Date: Thu, 15 Aug 2013 20:47:45 -0400
Being new to Eclipse, I am trying to understand some basic concepts. I
don't understand why are some Eclipse predicates not available from inside
loops. For example:

# test.ecl
main :-
  (foreach(A,[1,2]) do
      Z is string(A),
      writeln( Z )
    ).

$ eclipse -b test.ecl -e main
calling an undefined procedure string(1, _105343) in module eclipse
abort


These are available from the command line when I query the data, but not
from within the program. How do I do type checking on the variables if I
can't use these...?

Almost exactly the same problem with comparison operators:

fn1 :-
  (foreach(A,[1,2]) do
      Z is compare("<", A, 1),
      writeln( Z )
    ).
  %% calling an undefined procedure compare("<", 1, 1, _103944) in module
eclipse
  %% abort

fn2 :-
  (foreach(A,[1,2]) do
      writeln( A = 1 )
    ).
  %% 1 = 1
  %% 2 = 1


Can someone point me in the right direction please?
Received on Fri Aug 16 2013 - 00:48:22 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 17 2013 - 06:13:32 CEST