[PPL-devel] Re: [Xsb-development] read_term/2
Roberto Bagnara
bagnara at cs.unipr.it
Wed Aug 7 11:21:15 CEST 2002
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).
--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it
More information about the PPL-devel
mailing list