eval-stream?
Posted: Tue Jan 13, 2004 6:45 am
There was this topic 'What about (read)' here:
http://www.alh.net/newlisp/phpbb/viewto ... string#375
http://www.alh.net/newlisp/phpbb/viewto ... string#375
Now with the new possibilitys of SQLite or other import function, which could give back huge strings, it might be usefull to have a command like 'eval-string' with the capabilitys of 'load'.Or is there no more difference between 'eval-string' and 'load' because memory impact has happened yet and it is nothing to optimise in 'eval-string'?What 'load' does is more or less this:
(eval-string (read-file "afile.lsp"))
The only difference is that 'load' will stream the file and at the same time evaluate, while the above example reads the whole file first into a string, then evaluates it.
'load' can stream very large files without a memory impact, because it evaluates s-expressions as they flow in, compiling and evaluating on the fly.
Lutz