On Sun, Sep 26, 2010 at 22:03, Phil Hagelberg <p...@hagelb.org> wrote:

> On Sun, Sep 26, 2010 at 2:56 PM, Michael Ossareh <ossa...@gmail.com>
> wrote:
> > Situation: We've built a product, very rapidly thanks to being able to
> > produce stuff very quickly in clojure. However now that it is somewhat
> > settled I'm in the process of paring down the code, removing defunct
> fn's,
> > etc.
>
> It's actually pretty easy to identify what defns don't get run in a
> namespace with a judicious use of alter-var-root and metadata. I've
> implemented this in Radagast, my simple test coverage tool:
>
>    http://github.com/Seajure/radagast
>
>
Funny you should mention that, I actually have a script which uses radagast
and greps out the missed functions which begin with my namespace.



> > Problem: You compile your code, you test it, you pare down some functions
> or
> > rename a function and push that into the VM - hit refresh, everything
> works.
> > However there is a chance you are actually using a function which you
> have
> > removed from the source code. i.e. you missed a reference in another file
> or
> > something similar.
>
> We call this "getting slimed". There is currently no solution for this
> at least in Emacs. I would like to have a version of
> slime-compile-file that would remove all vars in the namespace before
> recompiling, but I haven't had the chance to implement it.
>


I'm happy there is a name for this!! sounds like the slime-compile-file
which removes the ns prior is really what I'm looking for.


>
> Patches welcome, of course.
>

:) Ooooh if there were only time, eh ;)

When I'm done with this mad dash I'll take a look.


>
> > Another solution I've been using is to regularly restart my running
> clojure
> > instance, however this has the annoyance of me losing all my locally
> defined
> > vars during dev.
>
> Restarting your VM should not be an annoyance. If you are creating
> data or functions in order to test, you should create them in your
> test suite. That way it's easy to run a fully-fresh run of the tests.
> You don't even have to restart your swank VM; it should be totally
> separate to avoid contamination.
>

Valid point, my test suite is woefully inadequate at the moment, a sign that
dev is very rapid I'd like to think :)

I'll keep this point in mind as I start to retroactively fit tests (a
process I'm spending about 20% of my time on atm).

BTW, Phil, thanks for all your work :)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to