[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: saving a numeric table to a disk file
- To: hmadorf@eso.org, mmeehan@eesof.com (Mike Meehan)
- Subject: Re: saving a numeric table to a disk file
- From: moon (David A. Moon)
- Date: Tue, 16 Jun 92 14:13:28 EDT
- Cc: info-mcl@cambridge.apple.com
> Date: Tue, 16 Jun 92 10:32:56 PDT
> From: mmeehan@eesof.com (Mike Meehan)
> ....
> Since it sounds like we are both new to lisp, I would very much like to hear the
> comments of the more experienced lispers...
These are just my personal comments, not anything from Apple the company:
It's rather easy, if the array contains only floats, to write code to do binary I/O
in MCL in exactly the same way you would write it in C, assuming that in C you use
the Macintosh I/O traps rather than the C I/O library. So you can write a binary
image of all the floats to a file and read it back with the same efficiency in either
language and with similar-looking code. I haven't actually done this for floats
but it should work. Use a specialized array :element-type double-float, of course.
You're getting no advantage from Lisp in this part of your program, but no disadvantage
either.
Bill St. Clair's suggestion of using a fasl file is good too, of course. It's much
easier than my suggestion, and might be as fast (or might be a lot slower, I haven't
tried measuring its speed).
The foreign function interface is also a reasonable approach to the problem. I don't
believe that Lisp is the solution to all problems. Use the most appropriate language
for each portion of your application and you'll thrive....