The Trunk: Tools-fbs.460.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-fbs.460.mcz

commits-2
Frank Shearar uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-fbs.460.mcz

==================== Summary ====================

Name: Tools-fbs.460
Author: fbs
Time: 19 April 2013, 8:40:24.143 am
UUID: d5cf82c4-bda7-48ff-bfbd-e8b27d0a07d7
Ancestors: Tools-fbs.459

When creating a stub method, give the argument names that represent the (usual) desired name more accurately. For instance, Arrays, OrderedCollections and Sets all result in 'aCollection', ByteStrings and WideStrings in 'aString', and so on.

Move #createStubMethod from Kernel.

=============== Diff against Tools-fbs.459 ===============

Item was added:
+ ----- Method: Boolean>>canonicalArgumentName (in category '*Tools-Debugger') -----
+ canonicalArgumentName
+ ^ 'Boolean'!

Item was added:
+ ----- Method: Class>>canonicalArgumentName (in category '*Tools-Debugger') -----
+ canonicalArgumentName
+ ^ 'Class'!

Item was added:
+ ----- Method: Collection>>canonicalArgumentName (in category '*Tools-Debugger') -----
+ canonicalArgumentName
+ ^ 'Collection'!

Item was added:
+ ----- Method: Integer>>canonicalArgumentName (in category '*Tools-Debugger') -----
+ canonicalArgumentName
+ ^ 'Integer'!

Item was added:
+ ----- Method: Message>>createStubMethod (in category '*Tools-Debugger') -----
+ createStubMethod
+ | argNames |
+ argNames := Set new.
+ ^ String streamContents: [ :s |
+ self selector keywords doWithIndex: [ :key :i |
+ | aOrAn argName arg argClassName |
+ s nextPutAll: key.
+ ((key last = $:) or: [self selector isInfix]) ifTrue: [
+ arg := self arguments at: i.
+ argClassName := arg canonicalArgumentName.
+ aOrAn := argClassName first isVowel ifTrue: ['an'] ifFalse: ['a'].
+ argName := aOrAn, argClassName.
+ [argNames includes: argName] whileTrue: [argName := argName, i asString].
+ argNames add: argName.
+ s nextPutAll: ' '; nextPutAll: argName; space
+ ].
+ ].
+ s cr; tab.
+ s nextPutAll: 'self shouldBeImplemented'
+ ].!

Item was added:
+ ----- Method: Number>>canonicalArgumentName (in category '*Tools-Debugger') -----
+ canonicalArgumentName
+ ^ 'Number'!

Item was added:
+ ----- Method: Object>>canonicalArgumentName (in category '*Tools-Debugger') -----
+ canonicalArgumentName
+ ^ self class name!

Item was added:
+ ----- Method: String>>canonicalArgumentName (in category '*Tools-Debugger') -----
+ canonicalArgumentName
+ ^ 'String'!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-fbs.460.mcz

Frank Shearar-3
On 19 April 2013 09:30,  <[hidden email]> wrote:

> Frank Shearar uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-fbs.460.mcz
>
> ==================== Summary ====================
>
> Name: Tools-fbs.460
> Author: fbs
> Time: 19 April 2013, 8:40:24.143 am
> UUID: d5cf82c4-bda7-48ff-bfbd-e8b27d0a07d7
> Ancestors: Tools-fbs.459
>
> When creating a stub method, give the argument names that represent the (usual) desired name more accurately. For instance, Arrays, OrderedCollections and Sets all result in 'aCollection', ByteStrings and WideStrings in 'aString', and so on.
>
> Move #createStubMethod from Kernel.
>
> =============== Diff against Tools-fbs.459 ===============

Kudos to Sean DeNigris, from whom I have blatantly copied.

frank