tiny revisions
This commit is contained in:
parent
953697c646
commit
29e0e3ace9
2 changed files with 4 additions and 4 deletions
|
|
@ -17,9 +17,9 @@
|
|||
<ul>
|
||||
<li><p>Start swank using the EQL executable, running the swank server in an ECL thread, and using the main thread for the Qt main event loop.</p>
|
||||
<li><p>Wrap every internal EQL function in a macro, which will call the function either directly (if called from GUI/main thread), or, if called from another ECL thread, will wrap the function call in a closure.</p>
|
||||
<li><p>This closure will be passed to a queued, blocking Qt function running in the GUI thread, which will in turn call the closure.</p>
|
||||
<li><p>This closure will be passed to a queued, blocking Qt function running on the UI thread, which will in turn call the closure.</p>
|
||||
</ul>
|
||||
<p>The crucial part is passing a Lisp closure from an ECL thread to Qt and calling it from C++ in the GUI/main thread.</p>
|
||||
<p>The crucial part is passing a Lisp closure from an ECL thread to Qt and calling it from C++ on the UI/main thread.</p>
|
||||
<p>This is trivial in ECL/Qt, since both ECL and Qt use/wrap native C threads, and Qt offers a nice utility with <code>Q_INVOKABLE</code>.</p>
|
||||
<p>First let's wrap the actual Lisp function, e.g. <code>(foo x y)</code> in a closure, so we only need to pass <b>one ECL closure pointer</b> to C++.
|
||||
<p>No need to pass Lisp arguments to C++, they are in the closure; no return value needed from C++, Lisp return values will be assigned in the closure:</p>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
return Cnil;
|
||||
}
|
||||
</pre>
|
||||
<p>Now the Lisp closure will run in the GUI/main thread, and the implementation of the Qt function <code>runInGuiThread</code> is as simple as:</p>
|
||||
<p>Now the Lisp closure will run on the UI/main thread, and the implementation of the Qt function <code>runInGuiThread</code> is as simple as:</p>
|
||||
<pre>
|
||||
|
||||
Q_INVOKABLE void runOnUiThread(void* closure) // note Q_INVOKABLE
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<li>Add to your <code>~/.swank.lisp</code> file (or copy file <code>eql5/slime/.swank.lisp</code> in your home directory):
|
||||
<br>(Please note: this isn't really optional -- you <b>need</b> to set this option for a useful Slime + EQL.)
|
||||
<pre>(setf swank:*globally-redirect-io* t) ; show print output in Emacs</pre>
|
||||
<li><p>Copy file <code>eql5/slime/eql-start-swank.lisp</code> in your <code>slime/</code> directory</p>
|
||||
<li><p>Copy file <code>~/.eql5/slime/eql-start-swank.lisp</code> in your <code>slime/</code> directory</p>
|
||||
<li><i>Optionally:</i><br>In order to indent <code>qlet</code> correctly, edit your <code>slime/contrib/slime-cl-indent.el</code> file and add a line:
|
||||
<pre>
|
||||
(let* (as let)) ; already there
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue