Hi all, I'm looking at the slime source code and I am pretty puzzled by slime-eval.
I think that I understand slime-rex, it sends an sexpr to Swank and pushes a destructure-case continuation onto the global continuation assoc list. At sometime later Swank returns the evaluation of the sexpr and calls either the :ok clause or the :abort clause.
The part that I am having trouble understanding is what parts of the code are closed over by the continuation that is saved, and where execution runs normally.
Looking at slime-eval, there needs to be two paths of execution, call them A and B. Path A is synchronous, slime-rex returns without throwing the tag. There is a while loop waiting on process-output, and the result of that while is passed to (apply #'funcall <result-of-while>) What is the usual return here though?
Path B is a continuation. The asynchronous return from Swank causes either :ok or :abort to be thrown up to the (catch tag...) form, and then (apply #'funcall....) will work on that.
Basically this all bends my mind, but is very cool at the same time. If somebody could please elaborate on what I have said, and correct me I would really appreciate it. There is probably a lot that I am not getting just now :) For example, why THROW? Couldn't the destructure-case sections just call/return the appropriate bits. Also, are there any ELisp/CommonLisp differences in this function?
Cheers Brad