purpose of the STREAM api in newlisp?
Posted: Wed Jun 24, 2015 6:27 am
Going through the newLISP source code I notice a very complete (and often used) API that passes around STREAM structures. These STREAM structures can be a file or a string.
I'm wondering, Lutz, what is the reason for this extensive API? It doesn't seem to be needed for cross-platform stuff. It does allow the evaluation and compilation functions to operate on strings in memory as well as files. But then, couldn't one read the file into memory?
Also, the macro MAX_STRING set to 2048 bytes, looks like perhaps the STREAM api was (or is?) intended for a low memory situation and reading source code in chunks. Perhaps related to the net-eval code?
I'm wondering, Lutz, what is the reason for this extensive API? It doesn't seem to be needed for cross-platform stuff. It does allow the evaluation and compilation functions to operate on strings in memory as well as files. But then, couldn't one read the file into memory?
Also, the macro MAX_STRING set to 2048 bytes, looks like perhaps the STREAM api was (or is?) intended for a low memory situation and reading source code in chunks. Perhaps related to the net-eval code?