Skip to content

Instantly share code, notes, and snippets.

@togi
Created June 6, 2010 09:51
Show Gist options
  • Save togi/427467 to your computer and use it in GitHub Desktop.
Save togi/427467 to your computer and use it in GitHub Desktop.
main :-
load_file('test.fil',X).
load_file(File, Out) :-
seeing(Old),
see(File),
read_lines(Out),
seen,
see(Old),
!.
read_lines([Line|Lines]) :-
\+ at_end_of_stream,
read_line(Data),
process_line(Data,Line),
read_lines(Lines).
read_lines([]).
process_line(X,Y) :- atom_codes(Y,X).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment