[armedbear-devel] Consolidating copy/paste code

Erik Huelsmann ehuels at gmail.com
Sun Apr 11 08:26:44 UTC 2010

Yesterday Ville and I dedicated some time to the consolidation of
copy/paste code and unnecessary virtual methods.

There's quite a bit of copy/paste code in ABCL. A good example are
LispReader, FaslReader and Stream.java. FaslReader had a number of
functions which were *exactly* equal to functions in LispReader. A
number of functions contained the same logic, but used different
readtables. The same applies to functions in Stream.java where
functions were declared twice - once with a faslRead* prefix and once
with a read* prefix.

The solution is - in this case, of course - to abstract the code from
the readtable to be used. In other places the reasons for copy/pasting
will be different.

If you're lurking at this list, thinking of contributing but you don't
know how: this is a much appreciated way to help out!

We try to reduce the number of (copy/pasted) lines of code in ABCL;
not at the expense of functionality, but as a way to ensure consistent
maintenance in the future.

Still no idea where to start? I left some remaining work in
LispReader.java and FaslReader.java where there is more copy/pasted
code. My idea is that the common bits get moved to Stream.java, using
the ReadtableAccessor class to abstract from the readtables

Looking forward to your contributions!



More information about the armedbear-devel mailing list