read_eval_file

read_eval_file — reads a file, evaluating and counting expressions.

Syntax

read_eval_file (file)

		

Arguments

file

A file pointer to a previously opened file. This may be either a file in the file system, or a string opened for read and write.

Returns

The number of expressions that were read and evaluated.

Description

This function reads from the current location in the file to the end, evaluating its contents as Lisp expressions and counting them.

Example

The file "myevalfile.dat" contains the following:

(+ 3 4) 3 + 2;

Gamma> ft = open ("myevalfile.dat", "r");
#<File:"myevalfile.dat">
Gamma> read_eval_file(ft);
4
Gamma> close(ft);
t
Gamma>  
		

See Also

require, load, open