The Trunk: System-mt.1069.mcz

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

The Trunk: System-mt.1069.mcz

commits-2
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1069.mcz

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

Name: System-mt.1069
Author: mt
Time: 11 July 2019, 9:21:36.166354 am
UUID: 27227430-c08f-3c47-b9fd-b646e7f948b6
Ancestors: System-mt.1068

Fixes minor regression in suggestedTypeNames. That is. 'someMorphThing' should also yield 'MorphThing', not just 'Morph' and 'Thing'.

=============== Diff against System-mt.1068 ===============

Item was changed:
  ----- Method: String>>suggestedTypeNames (in category '*system') -----
  suggestedTypeNames
 
  ^ Array streamContents: [:stream |
  self findFeatureIndicesDo: [:start :end |
  (self at: start) isUppercase ifTrue: [
  stream nextPut: (self copyFrom: start to: end).
+ end ~= self size ifTrue: [
+ stream nextPut: (self copyFrom: start to: self size) withBlanksTrimmed].
  "Often, argument names that refer to Collections end in the letter s, which can cause the suggested type-name to not be found. Account for this."
  (self at: end) = $s ifTrue: [
  stream nextPut: (self copyFrom: start to: end -1)]]]].!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1069.mcz

Chris Muller-3
Hi Marcel,

On Thu, Jul 11, 2019 at 2:21 AM <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1069.mcz

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

Name: System-mt.1069
Author: mt
Time: 11 July 2019, 9:21:36.166354 am
UUID: 27227430-c08f-3c47-b9fd-b646e7f948b6
Ancestors: System-mt.1068

Fixes minor regression in suggestedTypeNames. That is. 'someMorphThing' should also yield 'MorphThing', not just 'Morph' and 'Thing'.

Will it also yield 'someMorph' and 'someMorphThing'?  At first I thought the features only included the leaves, but this gives me hope that featuresDo: will enumerate all the nodes for me.

Thanks for doing this enhancement BTW, it bodes well for boosting the human<-->software bandwidth of Squeak's IDE even higher for users.

Best,
  Chris



 

=============== Diff against System-mt.1068 ===============

Item was changed:
  ----- Method: String>>suggestedTypeNames (in category '*system') -----
  suggestedTypeNames

        ^ Array streamContents: [:stream |
                self findFeatureIndicesDo: [:start :end |
                        (self at: start) isUppercase ifTrue: [
                                stream nextPut: (self copyFrom: start to: end).
+                               end ~= self size ifTrue: [
+                                       stream nextPut: (self copyFrom: start to: self size) withBlanksTrimmed].
                                "Often, argument names that refer to Collections end in the letter s, which can cause the suggested type-name to not be found. Account for this."
                                (self at: end) = $s ifTrue: [
                                        stream nextPut: (self copyFrom: start to: end -1)]]]].!




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-mt.1069.mcz

marcel.taeumel
Hi Chris,

for #suggestedTypeNames, it does not yield 'someMorph' and 'someMorphThing'. I suppose that method only exists for getting rid of prefix 'a' or 'some' or 'another' and suffix 's'.

Hmmm... #featuresDo: does not enumerate all combinations. It is a splitting algorithm on a flat stream of characters. It has no notion of the tree structure in source code; "features" means words in a piece of natural-language like text. If one wanted to enumerate all combinations (ignoring whitespace), it is possible as follows:

| input starts ends |
input := 'someMorphThing'.
starts := OrderedCollection new.
ends := OrderedCollection new.
combinations := OrderedCollection new.

input findFeatureIndicesDo: [:start :end |
starts add: start.
ends add: end].

starts do: [:start | ends do: [:end |
start < end ifTrue: [
combinations add: (input copyFrom: start to: end) ]]].

combinations explore.

I hope this answers your question. :-)

Best,
Marcel

Am 12.07.2019 04:58:37 schrieb Chris Muller <[hidden email]>:

Hi Marcel,

On Thu, Jul 11, 2019 at 2:21 AM <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1069.mcz

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

Name: System-mt.1069
Author: mt
Time: 11 July 2019, 9:21:36.166354 am
UUID: 27227430-c08f-3c47-b9fd-b646e7f948b6
Ancestors: System-mt.1068

Fixes minor regression in suggestedTypeNames. That is. 'someMorphThing' should also yield 'MorphThing', not just 'Morph' and 'Thing'.

Will it also yield 'someMorph' and 'someMorphThing'?  At first I thought the features only included the leaves, but this gives me hope that featuresDo: will enumerate all the nodes for me.

Thanks for doing this enhancement BTW, it bodes well for boosting the human<-->software bandwidth of Squeak's IDE even higher for users.

Best,
  Chris



 

=============== Diff against System-mt.1068 ===============

Item was changed:
  ----- Method: String>>suggestedTypeNames (in category '*system') -----
  suggestedTypeNames

        ^ Array streamContents: [:stream |
                self findFeatureIndicesDo: [:start :end |
                        (self at: start) isUppercase ifTrue: [
                                stream nextPut: (self copyFrom: start to: end).
+                               end ~= self size ifTrue: [
+                                       stream nextPut: (self copyFrom: start to: self size) withBlanksTrimmed].
                                "Often, argument names that refer to Collections end in the letter s, which can cause the suggested type-name to not be found. Account for this."
                                (self at: end) = $s ifTrue: [
                                        stream nextPut: (self copyFrom: start to: end -1)]]]].!