In newlisp, I notice that the prompt doesn't always reappear after I press Enter. I have to press enter a second time. Try it; start up newlisp, and hit enter at the prompt.
Now, if I type (println)[enter], the prompt comes back right away.
Does it happen with:
newlisp -n
This is the new multi-line entry feature, I talked about this morning (bottom part of the post):
http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=3726&p=18710#p18710
Also here in the manual of 10.2.16
http://www.newlisp.org/downloads/development/newlisp_manual.html#multiline
and also here in the 5th bullet
http://www.newlisp.org/downloads/development/newLISP-10.3-Release.html
Ah, sorry, my mistake. I hadn't realised it worked this way, and I haven't downloaded it yet. I thought it only went multi-line when it was above level 0 (ie until initial parenthesis is matched).
Thanks, that clears up the mystery. Is there a reason that multiline isn't the default, without having to type a blank line first?
This multiline mode doesn't count parentheses, you have to switch in and out. For efficiency reason reading source and parsing source are not intertwined as in traditional LISP interpreters, but they are separated to make the reading process as fast as possible for 'net-eval' on the server side. You want to bring the source as fast as possible over the wire in one big piece before parsing it. The new multiline mode leverages the existing code for multiline operation using the [cmd],[/cmd] tags which was already in newLISP and is used by 'net-eval'. The empty lines basically work as a replacement for those tags.
Would it be fairly involved for the interpreter shell to submit each line to the underlying parsing code as it is received, and only evaluate up to the last complete symbol or balanced paren? I mean, the parser already takes care of this in non-interactive mode, right? Or does the readline stuff make it too messy?
The point is, to do I/O on the entire multiline text, then parse and evaluate the entire chunk expression by expression in a second step. I am trying to leverage the multiline code based on the [cmd], [/cmd] tags used by 'net-eval' and which is designed for speed. I don't want to implement and entirely new multiline handling just for the interactive terminal.