[MCP][ENH] self deprecate for crufty methods
David T. Lewis
lewis at mail.msen.com
Wed Feb 19 22:47:58 UTC 2003
As part of MCP, there has been some discussion about cleaning out
unnecessary methods in Morphic. Here is a way to mark methods for
future removal. I'm sure this is not a new idea, but maybe it will
help with the housekeeping.
This change set adds Object>>deprecatedOn:by: to declare a method
obsolete and provide a warning to any sender of the message to
discourage use of the deprecated method.
Send "self deprecatedOn: aDateString by: yourNameOrInitials" in
the method being marked for future removal.
Dave
-------------- next part --------------
'From Squeak3.4gamma of ''7 January 2003'' [latest update: #5169] on 17 February 2003 at 1:24:51 pm'!
"Change Set: DeprecateMethods-dtl
Date: 17 February 2003
Author: David T. Lewis
Adds Object>>deprecatedOn:by: to declare a method obsolete and provide a warning to any sender of the message to discourage use of the deprecated method."!
!Object methodsFor: 'housekeeping' stamp: 'dtl 2/17/2003 13:14'!
deprecatedOn: aDateString by: initialsOrName
"Send this from a method which is being marked for future removal from
the image. aDateString should be the date at which the method is being
declared as obsolete."
"self deprecatedOn: Date today printString by: 'Dave Lewis'"
^ self notify: thisContext sender printString, ' was declared obsolete effective ',
aDateString, ' by ', initialsOrName,
' and will be removed from the image at some future date.'
! !
More information about the Squeak-dev
mailing list
|