Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Loading a file into a running image with Swank

15 views
Skip to first unread message

Patrick May

unread,
Dec 16, 2009, 11:36:56 AM12/16/09
to
I'm looking for documentation or an example of how to load a file
into a running Lisp image using Swank. I can do it from within Emacs
and Slime, but I need to be able to do it programmatically.

Thanks for any help.

Regards,

Patrick

------------------------------------------------------------------------
http://www.softwarematters.org
Large scale, mission-critical, distributed OO systems design and
implementation. (C++, Java, Common Lisp, Jini, middleware, SOA)

Alain Picard

unread,
Dec 16, 2009, 5:48:41 PM12/16/09
to
Patrick May <pat...@softwarematters.org> writes:

> I'm looking for documentation or an example of how to load a file
> into a running Lisp image using Swank. I can do it from within Emacs
> and Slime, but I need to be able to do it programmatically.

The typical way to bootstrap your way into such things is this.

What does C-c C-l do? Do C-h C-k (describe-key) C-c C-l

Emacs responds with
C-c C-l runs the command slime-load-file, which is an interactive
compiled Lisp function in `slime.el'.

The slime.el is clickable, and takes you to the definition of slime-load-file.

The last line of this function is:

(slime-eval-with-transcript `(swank:load-file ,lisp-filename))

Bang. You're in swank territory.

--ap

Patrick May

unread,
Dec 17, 2009, 7:40:33 AM12/17/09
to

Thanks!

Captain Obvious

unread,
Dec 17, 2009, 5:25:29 PM12/17/09
to
PM> I'm looking for documentation or an example of how to load a file
PM> into a running Lisp image using Swank. I can do it from within Emacs
PM> and Slime, but I need to be able to do it programmatically.

How is this going to be different from cl:load?


Patrick May

unread,
Dec 18, 2009, 10:50:08 AM12/18/09
to

I need to connect to a remote running image and evaluate cl:load
for a particular file on the remote machine. The Swank protocol isn't
documented, unfortunately, but I'm hacking around with it to get it to
do what I want.

The obvious alternative is to spawn a thread and listen on my own
socket for load requests.

Alain Picard

unread,
Dec 18, 2009, 10:18:25 PM12/18/09
to
Patrick May <pat...@softwarematters.org> writes:

> I need to connect to a remote running image and evaluate cl:load
> for a particular file on the remote machine.

You _do_ know that you can get a local SLIME to talk
to a remote SWANK server, right? Or maybe I'm completely
misunderstanding what you're trying to do.

--ap

Patrick May

unread,
Dec 19, 2009, 12:06:03 PM12/19/09
to

Yes, and I use that feature from Emacs. I would like to accomplish
the same thing from Common Lisp (Clozure, in particular)
programmatically rather than manually from within Emacs.

Alain Picard

unread,
Dec 19, 2009, 6:23:32 PM12/19/09
to
Patrick May <pat...@softwarematters.org> writes:

> Yes, and I use that feature from Emacs. I would like to accomplish
> the same thing from Common Lisp (Clozure, in particular)
> programmatically rather than manually from within Emacs.

That makes perfect sense. Good luck!

Captain Obvious

unread,
Dec 20, 2009, 6:35:13 PM12/20/09
to
PM> The obvious alternative is to spawn a thread and listen on my own
PM> socket for load requests.

The alternative would be to use some form of RPC, there are RPC servers
and clients for CL, and they are documented.


0 new messages