reading lists, matrices, and arrays



On Wed, Sep 17, 2003 at 12:05:19PM -0500, Barton Willis wrote:
> I wrote some code for reading lists, matrices, and arrays from a file.
...
> 
> (C3) read_list(fn);
> (D3)                             [0, 1, 2, 3, 4, 5, 6, 7, 8]

Very nice. I find it very useful.

> To read objects starting with the first and continue reading until either 
> 5 have been read or we run out of data, use the optional arguments
> 
> (C8) read_list(fn,1,5);
> (D8)                                   [0, 1, 2, 3, 4]
> (C9) read_list(fn,1,5);
> (D9)                                     [5, 6, 7, 8]
> (C10) read_list(fn,1,5);
> (D10)                                         []

The "1" seems redundant here. How about just "read_list(fn,5)" to do
the same thing and "read_list(fn,3,5)" to skip the next two numbers and
read the following three?

> io.lisp is about 156 lines long; I'll send it to anybody with an
> interest in developing a non-experimental version.  I'll 
> appreciate all comments. 
Please do send me a copy of it or tell me where I can find it.

Regards,
Jaime