[slime-devel] can't change *readtable* from repl
Alan Ruttenberg
alanralanr at comcast.net
Fri Mar 26 23:15:07 UTC 2004
Yes. Turns out openmcl defines a number of standard bindings that get
bound automatically unless overridden. Not sure what the appropriate
behavior is otherwise I'd make the change myself, but one way would be
to simply have spawn not bind any variables defined by common
lisp(currently *readtable* and *package*). Here's how you would do
that:
(defimplementation spawn (fn &key name)
(ccl:process-run-function (list :name (or name "Anonymous (Swank)")
:use-standard-initial-bindings nil
:initial-bindings
(remove-if (lambda(binding &aux
(cl-package (find-package "COMMON-LISP")))
(eq (symbol-package
(car binding)) cl-package))
(ccl::standard-initial-bindings))) fn))
What do the other lisps do?
An alternative would be to use the above version of spawn, but only
when spawning the threads that run from the repl.
-Alan
On Mar 25, 2004, at 2:03 AM, Helmut Eller wrote:
> Alan Ruttenberg <alanralanr at comcast.net> writes:
>
>> Noticed this because cl-interpol enabling function stopped working at
>> some point.
>
> This might be a threading issue. Each request, each expression typed
> into the repl, is evaluated in a new thread. But it seems to work in
> Allegro:
>
> CL-USER> *readtable*
> #<readtable @ #x2000c902>
> CL-USER> (copy-readtable)
> #<readtable @ #x20553ff2>
> CL-USER> (setq *readtable* *)
> #<readtable @ #x20553ff2>
> CL-USER> *readtable*
> #<readtable @ #x20553ff2>
> CL-USER>
>
> Does OpenMCL something special with *readtable*?
More information about the slime-devel
mailing list