[squeak-dev] The Trunk: 45Deprecated-nice.22.mcz
Frank Shearar
frank.shearar at gmail.com
Fri Dec 13 08:44:19 UTC 2013
I really like that ifNotNil: deprecation message :)
frank
On 12 Dec 2013, at 23:46, commits at source.squeak.org wrote:
> Nicolas Cellier uploaded a new version of 45Deprecated to project The Trunk:
> http://source.squeak.org/trunk/45Deprecated-nice.22.mcz
>
> ==================== Summary ====================
>
> Name: 45Deprecated-nice.22
> Author: nice
> Time: 13 December 2013, 12:46:20.984 am
> UUID: 6d95f31a-c2fc-44ed-8d57-bf17f0ec1a0e
> Ancestors: 45Deprecated-fbs.21
>
> Properly deprecate Parser>>initPattern:notifying:return: and provide a deserved explanation.
>
> =============== Diff against 45Deprecated-fbs.21 ===============
>
> Item was added:
> + ----- Method: Parser>>initPattern:notifying:return: (in category '*45Deprecated') -----
> + initPattern: aString notifying: req return: aBlock
> +
> + req
> + ifNil:
> + [self deprecated: 'Notifying nil is unnecessary, simply use #initPattern:return:'.
> + ^self initPattern: aString notifying: req return: aBlock]
> + ifNotNil:
> + [| result |
> + self deprecated: '#initPattern:return: was preferred because everybody was notifying nil, but you.
> + You could ask for re-integration of this message'.
> + self
> + init: (ReadStream on: aString asString)
> + cue: (CompilationCue source: aString requestor: req)
> + failBlock: [^nil].
> + encoder := self.
> + result := aBlock value: (self pattern: false inContext: nil).
> + encoder := failBlock := nil. "break cycles"
> + ^result]!
>
>
More information about the Squeak-dev
mailing list
|