/*
	The atoms are read from the file

	Version 2
		see, seeing, seen
*/

browse:- 
	% The name of the file is asked to the user. 
    display("File with quotes-> "),
	read(String),

	% Convert the String into an atom: File 
   name(File,String),		

	/* Save for later the current input  */ 
	seeing(Old),      

	/* Open the file and set as current input */ 
    see(File),        

	/* Loop driving by failure */
    repeat, 
		read(Atom),     /* read the atom from file */ 
		process(Atom),  /* process the atom */

	 /* Close the file */ 
	 seen,            

	/* Restore the previous current input */
     see(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. 
