[squeak-dev] The Trunk: Kernel-nice.807.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Sep 19 23:20:17 UTC 2013


It sounds like I'm repeating myself...
It sounds like code is repeating itself...
I always wonder if copy/paste is the best thing we ever invented...


2013/9/20 <commits at source.squeak.org>

> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-nice.807.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-nice.807
> Author: nice
> Time: 20 September 2013, 1:10:29.327 am
> UUID: 7e2508f3-57f2-4f2f-b1f2-e2d2ac123091
> Ancestors: Kernel-cmm.806
>
> If you just need the parameter names, then just ask for the parameter
> names.
> Asking for parameter and temp names, then throwing the temps away sounds
> like not using the right API in the right place...
>
> =============== Diff against Kernel-cmm.806 ===============
>
> Item was changed:
>   ----- Method: CompiledMethod>>replace:with:in: (in category 'private')
> -----
>   replace: oldSelector with: newSelector in: aText
>         | oldKeywords newKeywords args newSelectorWithArgs startOfSource
> lastSelectorToken |
>         oldKeywords := oldSelector keywords.
>         newKeywords := (newSelector ifNil: [self defaultSelector])
> keywords.
>         self assert: oldKeywords size = newKeywords size.
> +       args := self methodClass newParser parseParameterNames: aText
> string.
> -       args := (self methodClass newParser
> -               parseArgsAndTemps: aText string notifying: nil) copyFrom:
> 1 to: self numArgs.
>         newSelectorWithArgs := String streamContents: [:stream |
>                 newKeywords withIndexDo: [:keyword :index |
>                         stream nextPutAll: keyword.
>                         stream space.
>                         args size >= index ifTrue: [
>                                 stream nextPutAll: (args at: index);
> space]]].
>         lastSelectorToken := args isEmpty
>                 ifFalse: [args last]
>                 ifTrue: [oldKeywords last].
>         startOfSource := (aText string
>                 indexOfSubCollection: lastSelectorToken startingAt: 1) +
> lastSelectorToken size.
>         ^newSelectorWithArgs withBlanksTrimmed asText , (aText copyFrom:
> startOfSource to: aText size)!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130920/f517e009/attachment.htm


More information about the Squeak-dev mailing list