I uploaded the type collector on the Swiki in case someone wants to play with it separately from Whisker:
http://minnow.cc.gatech.edu/squeak/uploads/TypeCollector.cs
It has a few changes compared to the version I posted to this list about a year ago; the changes are essentially the same Doug made--limiting the number of instances to consider in case there are too many. As far as I remember, it modifies the comment template to include type information.
My guess is it should be easy to combine this with Dan's inferencer, just make the inferencer produce one of TcTypes and then use it as a seed when collecting types.
Doug Way wrote:
(I got this idea from a recent thread on comp.lang.smalltalk, in which it was suggested that some sort of double-quoted warning that "THIS CLASS IS NOT YET COMMENTED" should be added at the end of the class definition pane in VisualWorks browsers, which is also an excellent idea for Squeak. When all else fails, shame people into adding comments. ;-) )
I refined the idea a little since then, having implemented and used it for while. Here is what I found, in case someone wants to go in this direction.
- It's really neat and more convenient than separate browser modes. Even though you only see the top of a comment this way, it's often enough to attract your attention and "seduce" into reading further. On a couple of occasions already, I've seen interesting things I would never see otherwise because I would never intentionally go read those classes' comments.
- Another possible approach would be rolling the comment into the class definition message. I prefer to just have the browser combine them instead. This way it's easier to deal with formatted comment text.
- For the same reason, I dropped the idea that the comment should be appended as a proper Smalltalk comment, in double quotes (and with double quotes inside doubled). Double double quotes look too weird, and as you edit the comment it's too easy to forget to double them. Instead, I made the definition view have two parts, upper for the definition, lower for the comment text. The comment text appears "as is", without any quotes or escapes. Two view parts are not in the sense of two separate widgets. It's a single scrollable text view, separated into two portions. When you accept, the contents of two portions are saved separately.
In my experience, this is the most convenient arrangement. Yes, it does show "THIS CLASS HAS NOT BEEN COMMENTED" if the comment is missing, and yes, it is a strong shame factor. :)
Cheers,
--Vassili
squeak-dev@lists.squeakfoundation.org