
Hi there,
are there any plans to implement the ISO predicate read_term/2?
More specifically, I would need the functionality provided by
read_term(T, [variable_names(VN)])
Any idea how I could obtain that effect in the current version of XSB? Thanks in advance
Roberto

look in xsb_read.P there is something like file_read/3 with 3th arg the var list in a particular form
it would be better to have this in the ISO way, but the functionality is there
Bart

Bart Demoen wrote:
look in xsb_read.P there is something like file_read/3 with 3th arg the var list in a particular form
it would be better to have this in the ISO way, but the functionality is there
Thanks Bart. Here is the hack I am using, in case others are interested.
:- import file_read/3 from xsb_read.
read_term(Term, [variable_names(VN)]) :- file_read(0, Term, L), convert_variable_names_list(L, VN).
convert_variable_names_list(L, VN) :- var(L), !, VN = []. convert_variable_names_list([A|L], [Name=Var|VN]) :- A =.. [_, Name, Var], convert_variable_names_list(L, VN).
participants (2)
-
Bart Demoen
-
Roberto Bagnara