read_eval_file

Gamma: Version 4.0
Prev |  | Next

# `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`

Prev | Home | Next
`read_char`, `read_double`, `read_float`, `read_long`, `read_short` | Up | `read_line`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.