ohoh:) Deprair Deprecair
DeDeprecate On Thu, Jul 24, 2014 at 9:11 AM, Ben Coman <[email protected]> wrote: > Camille Teruel wrote: > > > On 24 juil. 2014, at 17:05, stepharo <[email protected]> wrote: > > Camille > > Ammonite is not that sezzy :) > > > Because it has tentacles? :-D > > May be > autoRepair > selfRepair :) > > > Yes for example ;) > > > How about 'Reprecator' because you are Rep(airing)(Dep)recations. > > > > > Stef > On 24/7/14 14:34, Camille Teruel wrote: > > Hello Pharo users, > > I'm pleased to announce the release of Deprecator. > It's a prototype of a small tool that permits you to deprecate method by > annotating them with a <deprecated: ...> pragma. > This pragma takes a rewrite expression as argument that specifies how to > rewrite the message send to the deprecated method. > If such a deprecated method is executed, a warning is thrown and a > debugger opens. > This debugger has a little 'Rewrite' button that permits to rewrite the > sending method according to the rewrite expression and then resume the > execution with the new rewritten sending method :) > The implementation is a proof-of-concept and is a bit hacky here and > there, but it works. > > 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>*. > Note you can change the order of arguments or even the receiver. > > C>>deprecatedMethodArg1: o1 arg2: o2 > <deprecated: '`@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. > > The repo is on sSmalltalkHub: > MCHttpRepository > location: 'http://smalltalkhub.com/mc/CamilleTeruel/Deprecator/main' > user: '' > password: '' > > I hope for comments, feature suggestions, code reviews, contributors, > etc :) > BTW, if you have a better name for this project let me know! > For example, I thought about Ammonite because it's an extinct animal > (analogy with deprecated) and it fits the sea naming theme. > > Cheers, > Camille > > > > >
