I feel myself dumb (as usual), but is it a way to read an newlisp expression from file or string (buffer), not evaluating it? Something like read in both Common Lisp and Scheme?
With newLISP you can grow your lists from the right side!
read-file reads file as a string, not as an expression. I mean, if you file contains a line "(a b c)", or you have a string with the same content, how do you read or convert it to the list (a b c) ?
With newLISP you can grow your lists from the right side!
Internally such a function already exists. It reads one top-level term or s-expression from a file or string and returns. It would be easy to expose this function in the newLISP API.
The question is: what do you want to do with it? Perhaps there is a different way to achieve the same?
I wanted to do the same thing for the 'newLINT' idea--load a .lsp file as a list instead of executing it. Long after I gave up on making it, it occurred to me that perhaps doing
Dmi wrote:My needs was: code analyze/edit, reformat/reindent, sanitize (wrapping the string with (quote ) before eval-string is not a way in common).
What about Cyrill?
In fact the same: any processing of the newLISP programs in newLISP itself. My idea was to implement some experimental preprocessor: that one was probably not worth doing, but there are others.
With newLISP you can grow your lists from the right side!