File size: 611 Bytes
557a17a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
%% la_strings.pl
use_module(library(pio)).
use_module(library(dcg/basics)).
open_s(File,Mode,Stream) :-
atom_string(File1,File),
open(File1,Mode,Stream),!.
string_atom(String,Atom) :-
atom_string(Atom,String),!.
phrase_from_file_s(string(Output), String) :-
atom_string(String1,String),
phrase_from_file(string(Output), String1),!.
append_list2([],[]):-!.
append_list2(A1,B):-
A1=[A|List],
append_list2(A,List,B),!.
append_list2(A,[],A):-!.
append_list2(A,List,B) :-
List=[Item|Items],
append(A,Item,C),
append_list2(C,Items,B).
writeln1(Term) :-
term_to_atom(Term,Atom),
writeln(Atom),!.
|