Hi Everyone, I'm loading some code in to Pharo 7 that tries to use #ifNotNilDo:. There's already a transformation to re-write it to the correct #ifNotNil: - RBRuleIfNotNilDo. How can I apply the transformation to all existing methods in the image that call #ifNotNilDo:? Thanks, Alistair
Hi alistair If you run your program the code will be automatically transformed (I cannot check the deprecation definitino right now) Else have a look at tests of the ParseTreeRewriter. Stef On Sun, Nov 12, 2017 at 2:12 PM, Alistair Grant <akgrant0710@gmail.com> wrote:
Hi Everyone,
I'm loading some code in to Pharo 7 that tries to use #ifNotNilDo:.
There's already a transformation to re-write it to the correct #ifNotNil: - RBRuleIfNotNilDo.
How can I apply the transformation to all existing methods in the image that call #ifNotNilDo:?
Thanks, Alistair
Hi Stef, On 12 November 2017 at 14:34, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Hi alistair
If you run your program the code will be automatically transformed (I cannot check the deprecation definitino right now)
Else have a look at tests of the ParseTreeRewriter.
Stef
On Sun, Nov 12, 2017 at 2:12 PM, Alistair Grant <akgrant0710@gmail.com> wrote:
Hi Everyone,
I'm loading some code in to Pharo 7 that tries to use #ifNotNilDo:.
There's already a transformation to re-write it to the correct #ifNotNil: - RBRuleIfNotNilDo.
How can I apply the transformation to all existing methods in the image that call #ifNotNilDo:?
Thanks, Alistair
Thanks! #ifNotNilDo: was deprecated in Pharo 6, and the method was removed completely in Pharo 7. The easiest thing to do is to port #ifNotNilDo: forward to Pharo 7 so that the methods are automatically re-written. And then get the offending libraries to be updated. But that's another story. Thanks again, Alistair
I wonder if we packaged somewhere the removed deprecated method. We should do that but since we do it manually I guess that this is ad-hoc. Stef On Sun, Nov 12, 2017 at 2:45 PM, Alistair Grant <akgrant0710@gmail.com> wrote:
Hi Stef,
On 12 November 2017 at 14:34, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Hi alistair
If you run your program the code will be automatically transformed (I cannot check the deprecation definitino right now)
Else have a look at tests of the ParseTreeRewriter.
Stef
On Sun, Nov 12, 2017 at 2:12 PM, Alistair Grant <akgrant0710@gmail.com> wrote:
Hi Everyone,
I'm loading some code in to Pharo 7 that tries to use #ifNotNilDo:.
There's already a transformation to re-write it to the correct #ifNotNil: - RBRuleIfNotNilDo.
How can I apply the transformation to all existing methods in the image that call #ifNotNilDo:?
Thanks, Alistair
Thanks!
#ifNotNilDo: was deprecated in Pharo 6, and the method was removed completely in Pharo 7.
The easiest thing to do is to port #ifNotNilDo: forward to Pharo 7 so that the methods are automatically re-written.
And then get the offending libraries to be updated. But that's another story.
Thanks again, Alistair
Stephane Ducasse-3 wrote
I wonder if we packaged somewhere the removed deprecated method. We should do that but since we do it manually I guess that this is ad-hoc.
Stef
On Sun, Nov 12, 2017 at 2:45 PM, Alistair Grant <
akgrant0710@
> wrote:
Hi Stef,
On 12 November 2017 at 14:34, Stephane Ducasse <
stepharo.self@
> wrote:
Hi alistair
If you run your program the code will be automatically transformed (I cannot check the deprecation definitino right now)
Else have a look at tests of the ParseTreeRewriter.
Stef
On Sun, Nov 12, 2017 at 2:12 PM, Alistair Grant <
akgrant0710@
> wrote:
Hi Everyone,
I'm loading some code in to Pharo 7 that tries to use #ifNotNilDo:.
There's already a transformation to re-write it to the correct #ifNotNil: - RBRuleIfNotNilDo.
How can I apply the transformation to all existing methods in the image that call #ifNotNilDo:?
Thanks, Alistair
Thanks!
#ifNotNilDo: was deprecated in Pharo 6, and the method was removed completely in Pharo 7.
The easiest thing to do is to port #ifNotNilDo: forward to Pharo 7 so that the methods are automatically re-written.
And then get the offending libraries to be updated. But that's another story.
Thanks again, Alistair
It would also be possible to force the issue, and instead of keeping the definitions in image + rewrite on use, add the rules to a CompilerPlugin, either loaded by default when importing code, or as a "rewrite deprecated sends on import" toggle in the settings somewhere. Cheers, Henry -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Thanks!
#ifNotNilDo: was deprecated in Pharo 6, and the method was removed completely in Pharo 7.
The easiest thing to do is to port #ifNotNilDo: forward to Pharo 7 so that the methods are automatically re-written.
Yes, this would be best. we never deprecated ifNotNilDo: because it was too intrusive. With the retwriting deprecation it is possible, but then to not be intrusive, we need to keep the deprecated methods longer. Of course in the end, people only act if they are forced, so the question is if it would help that much. Marcus
Hi Marcus, On 21 November 2017 at 11:18, Marcus Denker <marcus.denker@inria.fr> wrote:
Thanks!
#ifNotNilDo: was deprecated in Pharo 6, and the method was removed completely in Pharo 7.
The easiest thing to do is to port #ifNotNilDo: forward to Pharo 7 so that the methods are automatically re-written.
Yes, this would be best.
we never deprecated ifNotNilDo: because it was too intrusive. With the retwriting deprecation it is possible, but then to not be intrusive, we need to keep the deprecated methods longer.
Of course in the end, people only act if they are forced, so the question is if it would help that much.
Actually I meant that I will just port the rewrite rule forward in my image, not that it should be done as part of the official distribution. I agree that we need to be forced, and we don't want to clutter up the image with an ever growing list of deprecated methods, so I'm fine with the current process. Sorry for the poor choice of wording. Cheers, Alistair
participants (4)
-
Alistair Grant -
Henrik Sperre Johansen -
Marcus Denker -
Stephane Ducasse