From: Martin B. <mar...@go...> - 2012-02-13 19:04:02
|
Stas, thanks for our reply. That was exactly want I wanted. Best regards Martin Am 12.02.2012 um 22:10 schrieb Stas Boukarev: > Martin Buchmann <mar...@go...> writes: > >> Hi all, >> >> I want to define an easy way to start sbcl on a remote machine running SLIME's swank server as described in the SLIME manual [1]. Because I do not want to type all the commands over and over again, I thought of a solution similar to the way linedit is invoked [2], i.e. define some command line argument in my .sbclrc file which load swank-loader and creates the server, etc. >> >> I started with this and its working fine. If I invoke sbcl with the option "--swank" the message is printed in the repl and I can invoke the command '(swank-loader:init)' in it. >> >> (when (member "--swank" sb-ext:*posix-argv* :test 'equal) >> (setf sb-ext:*posix-argv* >> (remove "--swank" sb-ext:*posix-argv* :test 'equal)) >> (load "/path/to/swank-loader.lisp") ;; or (asdf:operate 'asdf:load-op 'swank) ; with same result >> (print "Loading Swank...")) >> >> Of course, this is a bit pointless because I want to add '(swank-loader:init)', etc. also to my .sbclrc file. But when I try this I get the following error even if I do not add "--swank" to the invocation of sbcl. > Use (funcall (read-from-string "swank-loader:init")). > >> I have no idea why the package swank-loader causes problems even if >> the body of the when macro shouldn't matter. Maybe I am missing >> something about macro evaluation here. Nevertheless, I would love to >> know how I can utilize my basic idea of saving typing while invoking >> sbcl on a remote machine with SLIME's swank-server already running. > That's not about macros. The error happens at read-time. The whole WHEN > form is read at once, and SWANK-LOADER package doesn't exist at that > time. > > -- > With best regards, Stas. |