Tuesday, September 6, 2011

Sorting things out

OK, I'm tired of working on the new compiler, so I decided to fix up the SORT function. I had a student working on it last semester, and he had made some good forward work. Then he managed to crash the compiler. Not ours; the Java compiler. Ouch! So it was left on the floor for a while.

Ok, last weekend I decided to fix it up. I had broken a toe, so I wasn't going anywhere anyway. Going back with some of the Java code was a good thing. It showed some problems in the basic type system. I moved the java.util.List and java.util.Collection interface packages up to the lisp.common.type.Sequence interface. This forced me to complete the code for all of the affected classes. The next thing to redo is the implementation for the SortComparator (implements the Java compareTo method). The student didn't realize that compareTo has 3 possible values rather 2. hmmm.

This is where the type system gets a bit squirrelly in handling Vectors. More on that after I get sorting lists working.

No comments:

Post a Comment