On Wed, Apr 10, 2013 at 2:33 PM, John Benediktsson <mrj...@gmail.com> wrote:

> You should really look at how the lint tool works.
>
> In particular, look at "lint" and see how it looks for a word which has a
> definition that is contained in another word (where the second word should
> be calling the first instead of duplicating its definition).
>
> Your version could look for common subsequences instead, perhaps.
>
> You'll want to filter out subsequences of 1,
>

True.


> and probably some simple things like "0 >" which probably isn't worth
> factoring out.
>

To simplify the algorithm, the tool could be made non-interactive.

Instead of prompting for when to refactor, the tool simply outputs a list
of all duplicate code snippets.

The list is sorted by the string length of its elements.

Then things not worth factoring out, like "0 >" appear at the end and can
be easily ignored.

This seems more straightforward than maintaining a list of things not worth
factoring out.
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to