Deprecated protocols

Stefan Matthias Aust sma at 3plus4.de
Sat Mar 25 17:51:18 UTC 2000


[...]

>1971CornerRounder-ar -- Andreas Raab -- 24 March 2000
>Update 1967 used a now deprecated protocol in Canvas - this was already 
>fixed in update 1862 but made it's way back"

This reminds me...  I really like the way you can explicitly deprecate
methods in Java so that the compiler can warn other people that they're
using old methods.  What's about adding a similar service to Squeak?

Let's say, we deprecate methods by adding the word "Deprecated." at the
beginning of the method's comment.  So 

fooFar
  "Deprecated. Used to foo a bar. Use fooBaz now."

would be an example of a deprecated method definition.  We can add a simple
#isDeprecated testing method to CompiledMethod which will try to locate the
source code and peek into its first comment.  Then, we could add services
like #browseDeprecatedMethods and #browseSendersOfDeprecatedMethods to
SystemDictionary.  These methods would enumerate all Classes and their
methods to find deprecated CompiledMethod instances and in the latter case
find all senders of that methods.

This is of course not as good as what Java's compiler can do because we
don't have static typing in Smalltalk and so polymorphism may fool us but
it might be still useful.

Comments?
bye
--
Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf.





More information about the Squeak-dev mailing list