Happy !

CamilleTeruel / Deprecator

Project infos

License MIT
Tags deprecation, rewritting
Creation date 2014-07-24
Website

Monticello registration

About Deprecator

A small tool that permits you to deprecate methods by annotating them with a


Example:

You have a class C with a method that you deprecate. Its rewrite expression tells that if it's executed as the result of a message send of the form:

<receiver> deprecatedMethodArg1: <arg1> arg2: <arg2>,

this message send should be rewritten to:

<receiver> replacementMethodArg1: <arg2> arg2: <arg1>.

You can change the order of arguments or even the receiver.

C>>deprecatedMethodArg1: o1 arg2: o2
    <deprecatedIn: #MySoft43 replaceWith: 'receiver replacementMethodArg1: arg2 arg2: arg1'>
    ^ #deprecated

C>>replacementMethodArg1: o1 arg2: o2
    ^ #replacement

C>>senderMethod
    ^ self deprecatedMethodArg1: 1 + 1 arg2: 2 + 2.

Then if you execute C new senderMethod, and then click on the "Rewrite" button of the debugger, then sending method is rewritten to:

C>>senderMethod
    ^ self replacementMethodArg1: 2 + 2 arg2: 1 + 1.

and the result is #replacement.