This is very pre-alpha software, still in development. Use at your own risk. By Larry Clapp, larry@theclapp.org Definition, purpose, support ---------------------------- See http://wiki.alu.org:80/Perl_interface_to_SLIME and http://www.lispniks.com/mailman/listinfo/slimpl. Install steps ------------- The package is currently just a snapshot of my development directory. So unpack it pretty much anywhere, cd into it, and keep reading. Testing ------- You can skip this part if you want. If you go to Running and try it and it works, the tests are moot, yes? :) Try prove t/*.t When I do it, I get all OKs: $ prove t/*.t t/0-perl-lisp..................ok t/0-various-mocks..............ok t/1-stand-alone................ok t/2-process_available_input....ok t/3-network....................ok t/4-eval-async.................ok t/5-eval-async-end-to-end......ok t/6-eval.......................ok All tests successful. Files=8, Tests=180, 1 wallclock secs ( 0.96 cusr + 0.12 csys = 1.08 CPU) If you don't get all OKs, skip the testing and go to the Running section and just try it. :) If you come back here anyway, configure CPAN and install Bundle::Test and the below list of modules. This can be a laborious process and I do not envy you your task. Debian folks can install some (maybe all) of these modules as packages (noted in parentheses). Note that the Debian versions can lag CPAN, sometimes by quite a lot. If you install all the Debian modules and the tests still don't pass, go to CPAN. Possibly incomplete list of modules used: Test::More (perl-modules) Test::MockModule (libtest-mockmodule-perl) Test::MockObject (libtest-mockobject-perl) Test::Exception (libtest-exception-perl) Data::Dumper (I think this comes with the core Perl distro these days) Modules included with the SLIMPL tarball: Various Lisp::* from perl-lisp-0.06. Once you've done that, try the "prove t/*.t" again. If you still get failures, try running the test script individually: $ perl t/1-stand-alone.t $ perl t/2-process_available_input.t and so forth, and email me or the mailing list with what fails. Does your Vim have Perl compiled in? ------------------------------------ Start your Vim and say :ver If you don't see +perl (or +perl/dyn) somewhere in the list of features (they're alphabetical), Slim-Vim won't work for you. - Debian users can install package vim-perl. - Native Windows Vim users (as opposed to Cygwin Vim users), assuming you use the Windows Vim from vim.org, should already have +perl/dyn. - Cygwin Vim users ... well, I couldn't find a pre-packaged Cygwin Vim that has Perl enabled, so I put mine (executable only; also includes GTK2 support, so may require that you have X installed, too) at http://theclapp.org/slimpl/vim.exe. The md5sum is abed6d56b3d37fec60da96d369fecd0e. I could put up a whole package, or one with no X support, if there's some demand. - OSX users are on your own, for the moment. (FIXME) The Vim (6.2!) on my wife's OSX machine doesn't have +perl. Anyway, if you see +perl or +perl/dyn, try this Vim command: :perl VIM::Msg( "Hello, World!" ) If you don't see "Hello, World" in the status line, you need to install Perl. Unix-types probably know what to do; Windows types should get the ActiveState Perl distribution at http://www.activestate.com/Products/ActivePerl. You only need the free Perl interpreter, not any of the for-$$ stuff. Click the "free download" link. Feedback on this paragraph welcome: is there something I've forgotten that you have to do to let Vim find Perl? Starting Lisp and Swank ----------------------- Get the latest Slime from CVS. See http://common-lisp.net/project/slime/. Or download the slime snapshot at http://theclapp.org/slimpl. Start your Lisp and start the Swank server: ; This works with clisp and CMU CL under Linux, at least ; Obviously change the path according to where you put your Slime source. (load "/usr/src/slime/swank-loader") (swank:create-server :dont-close t) Alternatively, I included the below in the include "run-swank.lisp" file: (load "/usr/src/slime/swank-loader") (defun run-swank () (swank:create-server :dont-close t)) (run-swank) Obviously you'd have to change the path to wherever you have slime installed. But once you do that, you could just say clisp -x '(load "run-swank")' Or you could put the load and the defun into your Lisp's rc file, e.g. $HOME/.clisprc, and start clisp like so: clisp -x "(run-swank)" If you can't figure out how to start Swank on your Lisp, please post on the slimpl mailing list. Please include your OS (including version number, if any), Lisp implementation, and Lisp version number. Running: Try the Perl REPL -------------------------- Open a terminal window and start the Swank server (see above). Open another window and start the Perl REPL: $ perl slimpl-repl.pl > (+ 1 1) result is => 2 (#x2, #o2, #b10) > q Type "q" by itself to quit. The Perl REPL only works with single-line expressions. The above is almost all the testing I've done. (I've added other numbers than 1 and 1 and defined a function or two, but that's about it.) Running: Try Slim-Vim --------------------- See above about "does your Vim have Perl compiled in?". Open a terminal window and start the Swank server (see above). Open another window and start Vim (or gvim, or whatever). You can edit a new file, or start with the "test-slim-vim.lisp" supplied with the SLIMPL package. Source slim-vim.vim: :so slim-vim.vim Type a short Lisp expression (+ 1 1) put the cursor somewhere inside it (+ 1 1) ^ make sure you're in "normal mode", and type \es (or ,es or |es or use whatever you have set to; the default is backslash '\'. If you know enough to set Leader, you know enough to remember that you've set it. :help leader.). "es" stands for "evaluate s-expression". If all goes well, Vim should display the result of the function in the bottom line of the window, where colon commands go: => 2 (#x2, #o2, #b10) This mode can accept any length expression. In theory, at least. I haven't stress-tested it. So far the most I've done is the four line factorial function in test-slim-vim.lisp. Errors / exceptions / conditions: The debugger: not working yet --------------------------------------------------------------- Swank sends specific events when Lisp invokes the debugger. SLIMPL doesn't handle any of those events yet. If your Lisp starts its debugger, you'll probably see some funky diagnostics at the bottom of your screen along the lines of "Unknown Event" followed by a bunch of stuff from Swank. In that case, you need to abort your Swank server and restart it. In clisp (under Linux), you can press ^C and that's it (assuming you've started the swank server the way I've specified above). (Under Windows ^C aborts the process.) In CMU CL (on my machine at least), you have to press ^\, and you can proceed with the below reconnect. In any case, you then have to tell vim :call Connect2Swank( 1 ) to make Vim re-connect to Swank. Conclusion ---------- As mentioned, this is pre-alpha software, version 0.04. "If it breaks, you get to keep both pieces." :) That said, please report your findings (ideally) to the SLIMPL list (see http://www.lispniks.com/mailman/listinfo/slimpl), or directly to me (larry@theclapp.org). Thank you for your interest. License ------- perl-lisp modules Copyright 1997 Gisle Aas: The perl-lisp library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://search.cpan.org/~gaas/perl-lisp-0.06/ SLIMPL is Copyright 2006 by Larry Clapp. You must pay me ONE BILLION DOLLARS to use it, or even look at the source. (Or would that be (:DrEvil "ONE BILLION DOLLARS") ? :) Okay, just kidding. SLIMPL is also free software. You can redistribute it and/or modify it under the same terms as Perl itself.