<div dir="ltr">Not sure how ABCL handles overloading, but couldn't you overload the function that's gone haywire or something that it calls?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 11, 2019 at 7:55 PM Alan Ruttenberg <<a href="mailto:alanruttenberg@gmail.com">alanruttenberg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 11, 2019 at 10:35 PM Elliott, Clark <<a href="mailto:elliott@depaul.edu" target="_blank">elliott@depaul.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear ABCL experts,<br>
<br>
I am working on AI system development in LISP. I like using ABCL because of its easy portability to Windows, Mac, and Linux and its direct access to Java. I am running ABCL in emacs shells, often as several processes at once, communicating via sockets. The LISP is working very well indeed. Great job!<br>
<br>
I've slogged through getting things like sockets and threads running--mostly using apropos and guessing--but it takes a lot of time. I STRONGLY prefer to work from examples of running code.<br>
<br>
I would dearly love some tips on the following:<br>
<br>
1. Are there repositories of ABCL-specific running code, small programs, utility applications and etc. showing the actual running of ABCL implementation-specific functions? Native ABCL networking? ABCL tricks? Examples of running programs using the native threads? Examples of small systems using Java-to-LISP and LISP-to-Java (beyond the given short examples)?<br></blockquote><div> </div><div>My project <a href="https://github.com/alanruttenberg/lsw2" target="_blank">LSW2</a> uses ABCL extensively. It isn't organized for documentation but browsing through it you will find lots of usage of java libraries using JSS. The util directory might have some relevant examples. I haven't used native threads - instead there is <a href="https://github.com/lmj/lparallel" target="_blank">lparallel</a> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2. How can I stop a runaway ABCL LISP function and return to top-level LISP without having to blow away the emacs buffer, and thus my entire current LISP context? In other LISPs I've had some kind of control key sequence, but can't find one for ABCL.<br></blockquote><div> </div><div>There isn't one because java doesn't allow general interrupts. If a process is grinding and never yielding then there's nothing you can do.</div><div>If you are writing the code then you can make sure you don't have long loops without every yielding. I tend to throw in a (sleep .01) strategically.</div><div>What you can do is have a process run the process you care about, sleeping most of the time. When sleeping it will recognize interrupts. The abort handler can request a thread be destroyed. Maybe it will be maybe it won't but at least you can be returned to the repl. util/geturl.lisp does this. I also mucked around with making a unix-like "&" to put a form in the background (running in its own thread). That's in util/background.lisp. With that you can use (& form) to put form in the background. There's a little doc at the top of the file. </div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">E.g.:<br></blockquote><div><br></div><div>Are you using slime? C-c C-c interrupts runaway just fine.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
(defun runaway ()<br>
(let ((n 0))<br>
(loop while (< (incf n) 10)<br>
;; Pretend this ran away. How do I kill it in ABCL REPL?<br>
do<br>
(sleep 1))))<br>
<br>
Thanks in advance for any help.<br>
<br>
Best,<br>
<br>
Clark<br>
<br>
</blockquote></div></div>
</blockquote></div>