When you work with SLIME and your code depends on customized readtable, how do you ensure slime requests are handled with your readtable?
I mean for example in CCL, when :span communication style is used by SLIME each requests is handled by new thread and new threads are initialized with default value of cl:*readtable*.
In my source code I have (eval-when (:compile-toplevel :load-toplevel :execute) (when (find-package :swank) (eval (read-from-string "(push `(*readtable* . ,*readtable*) swank:*default-worker-thread-bindings*)"))))
but I am afraid it is not the conventional way and depends on swank being already loaded at the moment my code is loaded.
What is the better way?
Best regards, - Anton
At Mon, 24 Jun 2013 08:05:58 +0400, Anton Vodonosov wrote:
When you work with SLIME and your code depends on customized readtable, how do you ensure slime requests are handled with your readtable?
They seem to be handled with my own readtable just fine (I use invert readtable for my commonqt stuff).
Do you have (in-package :yourpackage) on top of your source files, and is that package slime's current package?
From what I remember swank has a hashtable indexed by package name, of the readtable that was last seen in that package.. It broke for me when I used a macro that did (in-package), I had to put (in-package) back on top of my files. This is for SBCL.
Regards, Max
On Jun 24, 2013, at 12:05 AM, Anton Vodonosov avodonosov@yandex.ru wrote:
... how do you ensure slime requests are handled with your readtable? ...
See swank:*readtable-alist*. People like named-readtables (in quicklisp) which is aware of swank:*readtable-alist*.
FYI, i have a long forgotten related fix in my branch:
https://github.com/attila-lendvai/slime/commit/ae2addfa29a061d42d0fc69fb2206...
Aha, swank:*readtable-alist*, ok, thanks for the reference. But is it broken in the official slime?
25.06.2013, 11:54, "Attila Lendvai" attila.lendvai@gmail.com:
FYI, i have a long forgotten related fix in my branch:
https://github.com/attila-lendvai/slime/commit/ae2addfa29a061d42d0fc69fb2206...
-- • attila lendvai • PGP: 963F 5D5F 45C7 DFCD 0A39 -- “[...] so long as the people do not care to exercise their freedom, those who wish to tyrannize will do so; for tyrants are active and ardent, and will devote themselves in the name of any number of gods, religious and otherwise, to put shackles upon sleeping men.” — Voltaire (1694–1778), 'Anarchism & American Traditions' (1908)
At Tue, 25 Jun 2013 12:19:19 +0400, Anton Vodonosov wrote:
Aha, swank:*readtable-alist*, ok, thanks for the reference. But is it broken in the official slime?
In case you referring to "it works here" response by me, my CommonQt code is using "named-readtables" package, which adjusts swank:*readtable-alist* accordingly. I was under mistaken notion that Slime was doing it, until Ben pointed out otherwise in his response.
So Slime by itself does not do it, and never did (other then providing *readtable-alist*), you'll need to use "named-readtables" or patch your Slime with Atilla's patch above.
Regards, Max
So Slime by itself does not do it, and never did (other then providing *readtable-alist*), you'll need to use "named-readtables" or patch your Slime with Atilla's patch above.
a bit of clarification: stock slime (swank, really) does use *readtable-alist* but not everywhere. e.g. C-c C-c compiling works, but e.g. locating source locations dies with a reader error (e.g. when using 'v' in the debugger). my patch fixes the latter.