[ENH] deprecation 3
Doug Way
dway at riskmetrics.com
Wed May 21 16:52:17 UTC 2003
On Sunday, May 11, 2003, at 12:52 PM, Stephane Ducasse wrote:
> ...
> You can have a look at the KCP-63 on
> http://minnow.cc.gatech.edu/squeak/3083
This changeset looks good, but before we harvest it, I'd like to make
sure the examples in the class comment are clear about how to use the
methods.
Here's the example in the latest KCP-63 version:
"Idiom: Imagine I want to deprecated foo
foo
^ 'foo'
I can do
foo
self deprecatedExplanation: 'The method oldMethod was not good. Use
Bar>>foo instead'
^ 'foo'
or for certain cases such as primitive I rename foo as fooDeprecated
fooDeprecated
^ <primitive>
foo
^ self deprecated: [self fooDeprecated] explanation: 'The method
oldMethod was not good. Use Bar>>foo instead'"
I might at least change 'oldMethod' to 'foo' and Bar>>foo to
Bar>>newFoo in the examples to be more clear. Because #foo is what is
being deprecated, right?
So, the example might look like this:
"Idiom: Imagine I want to deprecate the message #foo...
foo
^ 'foo'
I can do
foo
self deprecatedExplanation: 'The method #foo was not good. Use
Bar>>newFoo instead'
^ 'foo'
or for certain cases such as when #foo implements a primitive, #foo
can be renamed to #fooDeprecated.
fooDeprecated
^ <primitive>
foo
^ self deprecated: [self fooDeprecated] explanation: 'The method #foo
was not good. Use Bar>>newFoo instead'"
Does this make sense?
- Doug Way
More information about the Squeak-dev
mailing list
|