I started using emacs and slime to develop some little service.
I have found a way to reload the code after changes but I want this a lot more convenient and faster.
This is how I doo it now:
1) start emacs, start slime, then in slime:
2) (load "init.lisp") ; load some initialisation code that does not change
3) (load "myseervice.lisp"); this containts the code that i am working on
4) (myservice:start)
5) At this point the seeervice is runing and i can test it. then I make changes to myseervice.lisp, to modify it. To swap the code to the new version I do this:
6) (myservice:stop)
7) (load "myservice.lisp")
8) go to 4) to start it again...
This works so far. But it is no fun to manually stop, reload and start. And there is a lot of output in slime between the calls, so it is not easy to reuse the previously typed commands 4)-7).
To have a solution I started a devhelper package which should do this for me in only one command, but it does not work:
(defpackage :devhelper
(:use :common-lisp :myservice)
(:export :start :reload))
(in-package :devhelper)
(defun start ()
(myservice:start))
(defun reload ()
(myservice:stop)
(load "myservice.lisp") ;I think it is not possible to load it here,
;because this module is using the file that it is just loading
;But it does not have to work this way,
;I just like any good solution
(myservice:start))
And I thought I could do it like this now:
1) start emacs, start slime, then in slime:
2) (load "init.lisp") ; load some initialisation code that does not change
3a) (load "myseervice.lisp"); this containts the code that i am working on
3b) (load "devhelper.lisp")
4) (devhelper:start)
5) At this point the seeervice is runing and i can test it. then I make changes to myseervice.lisp, to modify it. To swap the code to the new version I jussst dreamed I could:
6) (devhelper:reload)
But it freezes at this point.
And I am not sticking to this devhelper idea, I just want a smoother development cycle.
How would a real lisper do it? I am very new to all this and I come from conventional programming background ;) with IDEs and imports.