/*
	The atoms are read from the file

	Version 3
		open
*/

browse(File) :- 
	/* Save for later the current input  */ 
	current_input(Old),

	% Open for reading the file 
	open(File,read,Stream),       

	% The stream is the new current input
	set_input(Stream),

	% Loop driving by failure 
    repeat, 
		read(Atom),     % read the atom from file 
		process(Atom),  % process the atom 

	 % Close the stream
	close(Stream),   

	set_input(Old),
	% Stop now 
    !.

/* Atom of end of file */
process(end_of_file) :- !. 

/* Process the atom */
process(Atom) :-
		/* Write atom */
		write(Atom), 
		nl, 
		/* Loop driving by failure */
		fail. 
