Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - israel

#1
newLISP in the real world /
February 22, 2006, 07:08:44 PM
Thanks, that's exactly what I was looking for.



Bruce
#2
newLISP in the real world / interrupt handling
February 20, 2006, 05:44:29 PM
I just recently starting using newlisp, and have a problem that I haven't been able to find a solution to.  Newlisp's default for interrupt handling is not what I was expecting for a language that is built for scripting.  If I build a newlisp script for use in a pipeline, e.g.:



cat file | new-lisp-script.lsp | more



then it gets screwy on interrupts.  Specifically, if I ctrl-C or 'q' out of the more (say the input file is a lot bigger than expected), newlisp's interrupt handler goes to the:



    user reset -

    (c)ontinue, (d)ebug, e(x)it, (r)eset:



prompt, but since 'more' has terminated, nothing comes out on the screen, but it's still hanging on user inputer, and more CTRL-C's don't interrupt that.



Now since I know that it's waiting, I can type 'x<Ret>'.  But my point is that I shouldn't need to, and if this script is to be useable by anybody else besides me, then then they likely will not even know that the utitilty is built in newlisp, and that's what the interpreter requires.  So my question is how can I configure the script so that an interrupt immediately exits the entire program?



Secondly, I should be able to ^C out of that prompt also.  So my suggestion for another release is that when it's in the interrupt handler, another CTRL-C should act like an interrupt with no handler.



On the first, I'm even willing to do something like:



(define-interrupt-handler '(lambda () (exit))) if need be, though I think for scripting, either exit-on-interrupt should be the default or it should be an argument such as 'newlisp -Q'.



Bruce