The Inbox: 60Deprecated-ct.80.mcz

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

The Inbox: 60Deprecated-ct.80.mcz

commits-2
A new version of 60Deprecated was added to project The Inbox:
http://source.squeak.org/inbox/60Deprecated-ct.80.mcz

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

Name: 60Deprecated-ct.80
Author: ct
Time: 20 August 2020, 2:33:32.63864 pm
UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
Ancestors: 60Deprecated-mt.79

Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.

=============== Diff against 60Deprecated-mt.79 ===============

Item was added:
+ ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
+ collectWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexCollect: instead'.
+ ^ self withIndexCollect: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was changed:
  ----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
  menuSelectionsArray: aDirectory
  "Answer a menu selections object corresponding to aDirectory.  The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a selector to operate on and the second element of which contains the parameters for that selector."
 
  |dirSize|
  dirSize := aDirectory pathParts size.
  ^Array streamContents: [:s |
  canTypeFileName ifTrue:
  [s nextPut: (StandardFileMenuResult
  directory: aDirectory
  name: nil)].
  s nextPut: (StandardFileMenuResult
  directory: (FileDirectory root)
  name: '').
+ aDirectory pathParts withIndexDo:
- aDirectory pathParts doWithIndex:
  [:d :i | s nextPut: (StandardFileMenuResult
  directory: (self
  advance: dirSize - i
  containingDirectoriesFrom: aDirectory)
  name: '')].
  aDirectory directoryNames do:
  [:dn |  s nextPut: (StandardFileMenuResult
  directory: (FileDirectory on: (aDirectory fullNameFor: dn))
  name: '')].
  aDirectory fileNames do:
  [:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
  s nextPut: (StandardFileMenuResult
  directory: aDirectory
  name: fn)]]]]!

Item was changed:
  ----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
  pathPartsString: aDirectory
  "Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."
 
  ^String streamContents:
  [:s |
  s nextPutAll: '[]'; cr.
+ aDirectory pathParts asArray withIndexDo:
- aDirectory pathParts asArray doWithIndex:
  [:part :i |
  s next: i put: $ .
  s nextPutAll: part withBlanksTrimmed; cr]]!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: 60Deprecated-ct.80.mcz

marcel.taeumel
... just why?

Best,
Marcel

Am 20.08.2020 14:33:41 schrieb [hidden email] <[hidden email]>:

A new version of 60Deprecated was added to project The Inbox:
http://source.squeak.org/inbox/60Deprecated-ct.80.mcz

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

Name: 60Deprecated-ct.80
Author: ct
Time: 20 August 2020, 2:33:32.63864 pm
UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
Ancestors: 60Deprecated-mt.79

Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.

=============== Diff against 60Deprecated-mt.79 ===============

Item was added:
+ ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
+ collectWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexCollect: instead'.
+ ^ self withIndexCollect: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was changed:
----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
menuSelectionsArray: aDirectory
"Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a selector to operate on and the second element of which contains the parameters for that selector."

|dirSize|
dirSize := aDirectory pathParts size.
^Array streamContents: [:s |
canTypeFileName ifTrue:
[s nextPut: (StandardFileMenuResult
directory: aDirectory
name: nil)].
s nextPut: (StandardFileMenuResult
directory: (FileDirectory root)
name: '').
+ aDirectory pathParts withIndexDo:
- aDirectory pathParts doWithIndex:
[:d :i | s nextPut: (StandardFileMenuResult
directory: (self
advance: dirSize - i
containingDirectoriesFrom: aDirectory)
name: '')].
aDirectory directoryNames do:
[:dn | s nextPut: (StandardFileMenuResult
directory: (FileDirectory on: (aDirectory fullNameFor: dn))
name: '')].
aDirectory fileNames do:
[:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
s nextPut: (StandardFileMenuResult
directory: aDirectory
name: fn)]]]]!

Item was changed:
----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
pathPartsString: aDirectory
"Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."

^String streamContents:
[:s |
s nextPutAll: '[]'; cr.
+ aDirectory pathParts asArray withIndexDo:
- aDirectory pathParts asArray doWithIndex:
[:part :i |
s next: i put: $ .
s nextPutAll: part withBlanksTrimmed; cr]]!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: 60Deprecated-ct.80.mcz

Christoph Thiede

Sorry for the overhasty commit storm. From what the old method comment in SequenceableCollection >> #doWithIndex: stated, I believed that the formal deprecation of this selector was already decided but never realized:


"Use the new version with consistent naming"


In my image, #doWithIndex: has 89 senders opposed to #withIndexDo: which has 156 senders. #doWithIndex: could be a confusing name because usually, the latest phrase before the argument specifies the role or type of the argument, but in this case, the argument is not an index, but a block.


Marcel said #withIndexDo: could be considered as confusing either because its name would not match the arguments in the expected block. However, I think it still matches the order because the element is already represented by the receiver of the MessageSend:


classes withIndexDo: [:class :index | ...]


Open to hear your opinions! However we decide, I think it would improve the overall Smalltalk experience to have a single preferred name for protocols like this one to clean up the things.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 20. August 2020 14:39:58
An: squeak-dev
Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz
 
... just why?

Best,
Marcel

Am 20.08.2020 14:33:41 schrieb [hidden email] <[hidden email]>:

A new version of 60Deprecated was added to project The Inbox:
http://source.squeak.org/inbox/60Deprecated-ct.80.mcz

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

Name: 60Deprecated-ct.80
Author: ct
Time: 20 August 2020, 2:33:32.63864 pm
UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
Ancestors: 60Deprecated-mt.79

Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.

=============== Diff against 60Deprecated-mt.79 ===============

Item was added:
+ ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
+ collectWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexCollect: instead'.
+ ^ self withIndexCollect: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was changed:
----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
menuSelectionsArray: aDirectory
"Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a selector to operate on and the second element of which contains the parameters for that selector."

|dirSize|
dirSize := aDirectory pathParts size.
^Array streamContents: [:s |
canTypeFileName ifTrue:
[s nextPut: (StandardFileMenuResult
directory: aDirectory
name: nil)].
s nextPut: (StandardFileMenuResult
directory: (FileDirectory root)
name: '').
+ aDirectory pathParts withIndexDo:
- aDirectory pathParts doWithIndex:
[:d :i | s nextPut: (StandardFileMenuResult
directory: (self
advance: dirSize - i
containingDirectoriesFrom: aDirectory)
name: '')].
aDirectory directoryNames do:
[:dn | s nextPut: (StandardFileMenuResult
directory: (FileDirectory on: (aDirectory fullNameFor: dn))
name: '')].
aDirectory fileNames do:
[:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
s nextPut: (StandardFileMenuResult
directory: aDirectory
name: fn)]]]]!

Item was changed:
----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
pathPartsString: aDirectory
"Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."

^String streamContents:
[:s |
s nextPutAll: '[]'; cr.
+ aDirectory pathParts asArray withIndexDo:
- aDirectory pathParts asArray doWithIndex:
[:part :i |
s next: i put: $ .
s nextPutAll: part withBlanksTrimmed; cr]]!




Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: 60Deprecated-ct.80.mcz

marcel.taeumel
Thank you for this explanation. Would have made a great commit message ;-)

Also thanks for the highlighted example. Never thought of it that way. Makes sense.

Best,
Marcel

Am 20.08.2020 14:52:33 schrieb Thiede, Christoph <[hidden email]>:

Sorry for the overhasty commit storm. From what the old method comment in SequenceableCollection >> #doWithIndex: stated, I believed that the formal deprecation of this selector was already decided but never realized:


"Use the new version with consistent naming"


In my image, #doWithIndex: has 89 senders opposed to #withIndexDo: which has 156 senders. #doWithIndex: could be a confusing name because usually, the latest phrase before the argument specifies the role or type of the argument, but in this case, the argument is not an index, but a block.


Marcel said #withIndexDo: could be considered as confusing either because its name would not match the arguments in the expected block. However, I think it still matches the order because the element is already represented by the receiver of the MessageSend:


classes withIndexDo: [:class :index | ...]


Open to hear your opinions! However we decide, I think it would improve the overall Smalltalk experience to have a single preferred name for protocols like this one to clean up the things.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 20. August 2020 14:39:58
An: squeak-dev
Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz
 
... just why?

Best,
Marcel

Am 20.08.2020 14:33:41 schrieb [hidden email] <[hidden email]>:

A new version of 60Deprecated was added to project The Inbox:
http://source.squeak.org/inbox/60Deprecated-ct.80.mcz

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

Name: 60Deprecated-ct.80
Author: ct
Time: 20 August 2020, 2:33:32.63864 pm
UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
Ancestors: 60Deprecated-mt.79

Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.

=============== Diff against 60Deprecated-mt.79 ===============

Item was added:
+ ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
+ collectWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexCollect: instead'.
+ ^ self withIndexCollect: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was changed:
----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
menuSelectionsArray: aDirectory
"Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a selector to operate on and the second element of which contains the parameters for that selector."

|dirSize|
dirSize := aDirectory pathParts size.
^Array streamContents: [:s |
canTypeFileName ifTrue:
[s nextPut: (StandardFileMenuResult
directory: aDirectory
name: nil)].
s nextPut: (StandardFileMenuResult
directory: (FileDirectory root)
name: '').
+ aDirectory pathParts withIndexDo:
- aDirectory pathParts doWithIndex:
[:d :i | s nextPut: (StandardFileMenuResult
directory: (self
advance: dirSize - i
containingDirectoriesFrom: aDirectory)
name: '')].
aDirectory directoryNames do:
[:dn | s nextPut: (StandardFileMenuResult
directory: (FileDirectory on: (aDirectory fullNameFor: dn))
name: '')].
aDirectory fileNames do:
[:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
s nextPut: (StandardFileMenuResult
directory: aDirectory
name: fn)]]]]!

Item was changed:
----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
pathPartsString: aDirectory
"Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."

^String streamContents:
[:s |
s nextPutAll: '[]'; cr.
+ aDirectory pathParts asArray withIndexDo:
- aDirectory pathParts asArray doWithIndex:
[:part :i |
s next: i put: $ .
s nextPutAll: part withBlanksTrimmed; cr]]!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: 60Deprecated-ct.80.mcz

Christoph Thiede

I have stopped to commit the patches to all affected packages, which was a terrible idea as I recognize now. In case we can agree on deprecating #doWithIndex:, I am attaching the corresponding changeset.


FWIW, here is the snippet I used to rename all senders of the deprecated selectors:
oldSelector := #collectWithIndex:.
newSelector := #withIndexCollect:.

methods := self systemNavigation allCallsOn: oldSelector.
methods
	do: [:method |
		method actualClass compile: (method sourceCode
			copyReplaceTokens: oldSelector
			with: newSelector) ]
	displayingProgress: ('Replacing {1} with {2}' format: {oldSelector. newSelector})

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 20. August 2020 14:55:14
An: squeak-dev
Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz
 
Thank you for this explanation. Would have made a great commit message ;-)

Also thanks for the highlighted example. Never thought of it that way. Makes sense.

Best,
Marcel

Am 20.08.2020 14:52:33 schrieb Thiede, Christoph <[hidden email]>:

Sorry for the overhasty commit storm. From what the old method comment in SequenceableCollection >> #doWithIndex: stated, I believed that the formal deprecation of this selector was already decided but never realized:


"Use the new version with consistent naming"


In my image, #doWithIndex: has 89 senders opposed to #withIndexDo: which has 156 senders. #doWithIndex: could be a confusing name because usually, the latest phrase before the argument specifies the role or type of the argument, but in this case, the argument is not an index, but a block.


Marcel said #withIndexDo: could be considered as confusing either because its name would not match the arguments in the expected block. However, I think it still matches the order because the element is already represented by the receiver of the MessageSend:


classes withIndexDo: [:class :index | ...]


Open to hear your opinions! However we decide, I think it would improve the overall Smalltalk experience to have a single preferred name for protocols like this one to clean up the things.


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Donnerstag, 20. August 2020 14:39:58
An: squeak-dev
Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz
 
... just why?

Best,
Marcel

Am 20.08.2020 14:33:41 schrieb [hidden email] <[hidden email]>:

A new version of 60Deprecated was added to project The Inbox:
http://source.squeak.org/inbox/60Deprecated-ct.80.mcz

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

Name: 60Deprecated-ct.80
Author: ct
Time: 20 August 2020, 2:33:32.63864 pm
UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
Ancestors: 60Deprecated-mt.79

Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.

=============== Diff against 60Deprecated-mt.79 ===============

Item was added:
+ ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
+ collectWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexCollect: instead'.
+ ^ self withIndexCollect: elementAndIndexBlock!

Item was added:
+ ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
+ doWithIndex: elementAndIndexBlock
+
+ self deprecated: 'Use #withIndexDo: instead'.
+ ^ self withIndexDo: elementAndIndexBlock!

Item was changed:
----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
menuSelectionsArray: aDirectory
"Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a selector to operate on and the second element of which contains the parameters for that selector."

|dirSize|
dirSize := aDirectory pathParts size.
^Array streamContents: [:s |
canTypeFileName ifTrue:
[s nextPut: (StandardFileMenuResult
directory: aDirectory
name: nil)].
s nextPut: (StandardFileMenuResult
directory: (FileDirectory root)
name: '').
+ aDirectory pathParts withIndexDo:
- aDirectory pathParts doWithIndex:
[:d :i | s nextPut: (StandardFileMenuResult
directory: (self
advance: dirSize - i
containingDirectoriesFrom: aDirectory)
name: '')].
aDirectory directoryNames do:
[:dn | s nextPut: (StandardFileMenuResult
directory: (FileDirectory on: (aDirectory fullNameFor: dn))
name: '')].
aDirectory fileNames do:
[:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
s nextPut: (StandardFileMenuResult
directory: aDirectory
name: fn)]]]]!

Item was changed:
----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
pathPartsString: aDirectory
"Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."

^String streamContents:
[:s |
s nextPutAll: '[]'; cr.
+ aDirectory pathParts asArray withIndexDo:
- aDirectory pathParts asArray doWithIndex:
[:part :i |
s next: i put: $ .
s nextPutAll: part withBlanksTrimmed; cr]]!





deprecate #doWithIndex#.1.cs (127K) Download Attachment
Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: 60Deprecated-ct.80.mcz

Levente Uzonyi
Hi Christoph,

+1 from me to deprecate it.
Even if the final decision will be to not deprecate/remove those methods,
using #withIndex*: instead of #*WithIndex: in Trunk won't hurt.
So, feel free to push those changes, as those should be in the Trunk IMO.


Levente

On Thu, 20 Aug 2020, Thiede, Christoph wrote:

>
> I have stopped to commit the patches to all affected packages, which was a terrible idea as I recognize now. In case we can agree on deprecating #doWithIndex:, I am attaching the corresponding changeset.
>
>
> FWIW, here is the snippet I used to rename all senders of the deprecated selectors:
>
> oldSelector := #collectWithIndex:.
> newSelector := #withIndexCollect:.
>
> methods := self systemNavigation allCallsOn: oldSelector.
> methods
> do: [:method |
> method actualClass compile: (method sourceCode
> copyReplaceTokens: oldSelector
> with: newSelector) ]
> displayingProgress: ('Replacing {1} with {2}' format: {oldSelector. newSelector})
> [FORM]
>
> Best,
> Christoph
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Donnerstag, 20. August 2020 14:55:14
> An: squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz  
> Thank you for this explanation. Would have made a great commit message ;-)
> Also thanks for the highlighted example. Never thought of it that way. Makes sense.
>
> Best,
> Marcel
>
>       Am 20.08.2020 14:52:33 schrieb Thiede, Christoph <[hidden email]>:
>
>       Sorry for the overhasty commit storm. From what the old method comment in SequenceableCollection >> #doWithIndex: stated, I believed that the formal deprecation of this selector was already decided but never
>       realized:
>
>
>       "Use the new version with consistent naming"
>
>
>       In my image, #doWithIndex: has 89 senders opposed to #withIndexDo: which has 156 senders. #doWithIndex: could be a confusing name because usually, the latest phrase before the argument specifies the role or type
>       of the argument, but in this case, the argument is not an index, but a block.
>
>
>       Marcel said #withIndexDo: could be considered as confusing either because its name would not match the arguments in the expected block. However, I think it still matches the order because the element is already
>       represented by the receiver of the MessageSend:
>
>
>       classes withIndexDo: [:class :index | ...]
>
>
>       Open to hear your opinions! However we decide, I think it would improve the overall Smalltalk experience to have a single preferred name for protocols like this one to clean up the things.
>
>
>       Best,
>
>       Christoph
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Donnerstag, 20. August 2020 14:39:58
> An: squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz  
> ... just why?
> Best,
> Marcel
>
>       Am 20.08.2020 14:33:41 schrieb [hidden email] <[hidden email]>:
>
>       A new version of 60Deprecated was added to project The Inbox:
>       http://source.squeak.org/inbox/60Deprecated-ct.80.mcz
>
>       ==================== Summary ====================
>
>       Name: 60Deprecated-ct.80
>       Author: ct
>       Time: 20 August 2020, 2:33:32.63864 pm
>       UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
>       Ancestors: 60Deprecated-mt.79
>
>       Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.
>
>       =============== Diff against 60Deprecated-mt.79 ===============
>
>       Item was added:
>       + ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
>       + doWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexDo: instead'.
>       + ^ self withIndexDo: elementAndIndexBlock!
>
>       Item was added:
>       + ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
>       + collectWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexCollect: instead'.
>       + ^ self withIndexCollect: elementAndIndexBlock!
>
>       Item was added:
>       + ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
>       + doWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexDo: instead'.
>       + ^ self withIndexDo: elementAndIndexBlock!
>
>       Item was changed:
>       ----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
>       menuSelectionsArray: aDirectory
>       "Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a
>       selector to operate on and the second element of which contains the parameters for that selector."
>
>       |dirSize|
>       dirSize := aDirectory pathParts size.
>       ^Array streamContents: [:s |
>       canTypeFileName ifTrue:
>       [s nextPut: (StandardFileMenuResult
>       directory: aDirectory
>       name: nil)].
>       s nextPut: (StandardFileMenuResult
>       directory: (FileDirectory root)
>       name: '').
>       + aDirectory pathParts withIndexDo:
>       - aDirectory pathParts doWithIndex:
>       [:d :i | s nextPut: (StandardFileMenuResult
>       directory: (self
>       advance: dirSize - i
>       containingDirectoriesFrom: aDirectory)
>       name: '')].
>       aDirectory directoryNames do:
>       [:dn | s nextPut: (StandardFileMenuResult
>       directory: (FileDirectory on: (aDirectory fullNameFor: dn))
>       name: '')].
>       aDirectory fileNames do:
>       [:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
>       s nextPut: (StandardFileMenuResult
>       directory: aDirectory
>       name: fn)]]]]!
>
>       Item was changed:
>       ----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
>       pathPartsString: aDirectory
>       "Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."
>
>       ^String streamContents:
>       [:s |
>       s nextPutAll: '[]'; cr.
>       + aDirectory pathParts asArray withIndexDo:
>       - aDirectory pathParts asArray doWithIndex:
>       [:part :i |
>       s next: i put: $ .
>       s nextPutAll: part withBlanksTrimmed; cr]]!
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: 60Deprecated-ct.80.mcz

Eliot Miranda-2


On Thu, Aug 20, 2020 at 7:07 AM Levente Uzonyi <[hidden email]> wrote:
Hi Christoph,

+1 from me to deprecate it.
Even if the final decision will be to not deprecate/remove those methods,
using #withIndex*: instead of #*WithIndex: in Trunk won't hurt.
So, feel free to push those changes, as those should be in the Trunk IMO.

+1
 


Levente

On Thu, 20 Aug 2020, Thiede, Christoph wrote:

>
> I have stopped to commit the patches to all affected packages, which was a terrible idea as I recognize now. In case we can agree on deprecating #doWithIndex:, I am attaching the corresponding changeset.
>
>
> FWIW, here is the snippet I used to rename all senders of the deprecated selectors:
>
> oldSelector := #collectWithIndex:.
> newSelector := #withIndexCollect:.
>
> methods := self systemNavigation allCallsOn: oldSelector.
> methods
>       do: [:method |
>               method actualClass compile: (method sourceCode
>                       copyReplaceTokens: oldSelector
>                       with: newSelector) ]
>       displayingProgress: ('Replacing {1} with {2}' format: {oldSelector. newSelector})
> [FORM]
>
> Best,
> Christoph
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Donnerstag, 20. August 2020 14:55:14
> An: squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz  
> Thank you for this explanation. Would have made a great commit message ;-)
> Also thanks for the highlighted example. Never thought of it that way. Makes sense.
>
> Best,
> Marcel
>
>       Am 20.08.2020 14:52:33 schrieb Thiede, Christoph <[hidden email]>:
>
>       Sorry for the overhasty commit storm. From what the old method comment in SequenceableCollection >> #doWithIndex: stated, I believed that the formal deprecation of this selector was already decided but never
>       realized:
>
>
>       "Use the new version with consistent naming"
>
>
>       In my image, #doWithIndex: has 89 senders opposed to #withIndexDo: which has 156 senders. #doWithIndex: could be a confusing name because usually, the latest phrase before the argument specifies the role or type
>       of the argument, but in this case, the argument is not an index, but a block.
>
>
>       Marcel said #withIndexDo: could be considered as confusing either because its name would not match the arguments in the expected block. However, I think it still matches the order because the element is already
>       represented by the receiver of the MessageSend:
>
>
>       classes withIndexDo: [:class :index | ...]
>
>
>       Open to hear your opinions! However we decide, I think it would improve the overall Smalltalk experience to have a single preferred name for protocols like this one to clean up the things.
>
>
>       Best,
>
>       Christoph
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Donnerstag, 20. August 2020 14:39:58
> An: squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz  
> ... just why?
> Best,
> Marcel
>
>       Am 20.08.2020 14:33:41 schrieb [hidden email] <[hidden email]>:
>
>       A new version of 60Deprecated was added to project The Inbox:
>       http://source.squeak.org/inbox/60Deprecated-ct.80.mcz
>
>       ==================== Summary ====================
>
>       Name: 60Deprecated-ct.80
>       Author: ct
>       Time: 20 August 2020, 2:33:32.63864 pm
>       UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
>       Ancestors: 60Deprecated-mt.79
>
>       Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.
>
>       =============== Diff against 60Deprecated-mt.79 ===============
>
>       Item was added:
>       + ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
>       + doWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexDo: instead'.
>       + ^ self withIndexDo: elementAndIndexBlock!
>
>       Item was added:
>       + ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
>       + collectWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexCollect: instead'.
>       + ^ self withIndexCollect: elementAndIndexBlock!
>
>       Item was added:
>       + ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
>       + doWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexDo: instead'.
>       + ^ self withIndexDo: elementAndIndexBlock!
>
>       Item was changed:
>       ----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
>       menuSelectionsArray: aDirectory
>       "Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a
>       selector to operate on and the second element of which contains the parameters for that selector."
>
>       |dirSize|
>       dirSize := aDirectory pathParts size.
>       ^Array streamContents: [:s |
>       canTypeFileName ifTrue:
>       [s nextPut: (StandardFileMenuResult
>       directory: aDirectory
>       name: nil)].
>       s nextPut: (StandardFileMenuResult
>       directory: (FileDirectory root)
>       name: '').
>       + aDirectory pathParts withIndexDo:
>       - aDirectory pathParts doWithIndex:
>       [:d :i | s nextPut: (StandardFileMenuResult
>       directory: (self
>       advance: dirSize - i
>       containingDirectoriesFrom: aDirectory)
>       name: '')].
>       aDirectory directoryNames do:
>       [:dn | s nextPut: (StandardFileMenuResult
>       directory: (FileDirectory on: (aDirectory fullNameFor: dn))
>       name: '')].
>       aDirectory fileNames do:
>       [:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
>       s nextPut: (StandardFileMenuResult
>       directory: aDirectory
>       name: fn)]]]]!
>
>       Item was changed:
>       ----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
>       pathPartsString: aDirectory
>       "Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."
>
>       ^String streamContents:
>       [:s |
>       s nextPutAll: '[]'; cr.
>       + aDirectory pathParts asArray withIndexDo:
>       - aDirectory pathParts asArray doWithIndex:
>       [:part :i |
>       s next: i put: $ .
>       s nextPutAll: part withBlanksTrimmed; cr]]!
>
>
>
>


--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: 60Deprecated-ct.80.mcz

Christoph Thiede

Hi all,


any other opinions on this question? If not, shall I proceed to upload the changeset as separate inbox versions or can someone with Trunk permissions do this with one click? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Freitag, 21. August 2020 21:29:10
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz
 


On Thu, Aug 20, 2020 at 7:07 AM Levente Uzonyi <[hidden email]> wrote:
Hi Christoph,

+1 from me to deprecate it.
Even if the final decision will be to not deprecate/remove those methods,
using #withIndex*: instead of #*WithIndex: in Trunk won't hurt.
So, feel free to push those changes, as those should be in the Trunk IMO.

+1
 


Levente

On Thu, 20 Aug 2020, Thiede, Christoph wrote:

>
> I have stopped to commit the patches to all affected packages, which was a terrible idea as I recognize now. In case we can agree on deprecating #doWithIndex:, I am attaching the corresponding changeset.
>
>
> FWIW, here is the snippet I used to rename all senders of the deprecated selectors:
>
> oldSelector := #collectWithIndex:.
> newSelector := #withIndexCollect:.
>
> methods := self systemNavigation allCallsOn: oldSelector.
> methods
>       do: [:method |
>               method actualClass compile: (method sourceCode
>                       copyReplaceTokens: oldSelector
>                       with: newSelector) ]
>       displayingProgress: ('Replacing {1} with {2}' format: {oldSelector. newSelector})
> [FORM]
>
> Best,
> Christoph
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Donnerstag, 20. August 2020 14:55:14
> An: squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz  
> Thank you for this explanation. Would have made a great commit message ;-)
> Also thanks for the highlighted example. Never thought of it that way. Makes sense.
>
> Best,
> Marcel
>
>       Am 20.08.2020 14:52:33 schrieb Thiede, Christoph <[hidden email]>:
>
>       Sorry for the overhasty commit storm. From what the old method comment in SequenceableCollection >> #doWithIndex: stated, I believed that the formal deprecation of this selector was already decided but never
>       realized:
>
>
>       "Use the new version with consistent naming"
>
>
>       In my image, #doWithIndex: has 89 senders opposed to #withIndexDo: which has 156 senders. #doWithIndex: could be a confusing name because usually, the latest phrase before the argument specifies the role or type
>       of the argument, but in this case, the argument is not an index, but a block.
>
>
>       Marcel said #withIndexDo: could be considered as confusing either because its name would not match the arguments in the expected block. However, I think it still matches the order because the element is already
>       represented by the receiver of the MessageSend:
>
>
>       classes withIndexDo: [:class :index | ...]
>
>
>       Open to hear your opinions! However we decide, I think it would improve the overall Smalltalk experience to have a single preferred name for protocols like this one to clean up the things.
>
>
>       Best,
>
>       Christoph
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Donnerstag, 20. August 2020 14:39:58
> An: squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: 60Deprecated-ct.80.mcz  
> ... just why?
> Best,
> Marcel
>
>       Am 20.08.2020 14:33:41 schrieb [hidden email] <[hidden email]>:
>
>       A new version of 60Deprecated was added to project The Inbox:
>       http://source.squeak.org/inbox/60Deprecated-ct.80.mcz
>
>       ==================== Summary ====================
>
>       Name: 60Deprecated-ct.80
>       Author: ct
>       Time: 20 August 2020, 2:33:32.63864 pm
>       UUID: 1295269c-62ee-5c45-9315-e66ff5eef57a
>       Ancestors: 60Deprecated-mt.79
>
>       Finnaly deprecate #doWithIndex: and #collectWithIndex:. Other packages will be patched right now.
>
>       =============== Diff against 60Deprecated-mt.79 ===============
>
>       Item was added:
>       + ----- Method: HashedCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
>       + doWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexDo: instead'.
>       + ^ self withIndexDo: elementAndIndexBlock!
>
>       Item was added:
>       + ----- Method: SequenceableCollection>>collectWithIndex: (in category '*60Deprecated-enumerating') -----
>       + collectWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexCollect: instead'.
>       + ^ self withIndexCollect: elementAndIndexBlock!
>
>       Item was added:
>       + ----- Method: SequenceableCollection>>doWithIndex: (in category '*60Deprecated-enumerating') -----
>       + doWithIndex: elementAndIndexBlock
>       +
>       + self deprecated: 'Use #withIndexDo: instead'.
>       + ^ self withIndexDo: elementAndIndexBlock!
>
>       Item was changed:
>       ----- Method: StandardFileMenu>>menuSelectionsArray: (in category 'menu building') -----
>       menuSelectionsArray: aDirectory
>       "Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a
>       selector to operate on and the second element of which contains the parameters for that selector."
>
>       |dirSize|
>       dirSize := aDirectory pathParts size.
>       ^Array streamContents: [:s |
>       canTypeFileName ifTrue:
>       [s nextPut: (StandardFileMenuResult
>       directory: aDirectory
>       name: nil)].
>       s nextPut: (StandardFileMenuResult
>       directory: (FileDirectory root)
>       name: '').
>       + aDirectory pathParts withIndexDo:
>       - aDirectory pathParts doWithIndex:
>       [:d :i | s nextPut: (StandardFileMenuResult
>       directory: (self
>       advance: dirSize - i
>       containingDirectoriesFrom: aDirectory)
>       name: '')].
>       aDirectory directoryNames do:
>       [:dn | s nextPut: (StandardFileMenuResult
>       directory: (FileDirectory on: (aDirectory fullNameFor: dn))
>       name: '')].
>       aDirectory fileNames do:
>       [:fn | pattern do: [:pat | (pat match: fn) ifTrue: [
>       s nextPut: (StandardFileMenuResult
>       directory: aDirectory
>       name: fn)]]]]!
>
>       Item was changed:
>       ----- Method: StandardFileMenu>>pathPartsString: (in category 'menu building') -----
>       pathPartsString: aDirectory
>       "Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr."
>
>       ^String streamContents:
>       [:s |
>       s nextPutAll: '[]'; cr.
>       + aDirectory pathParts asArray withIndexDo:
>       - aDirectory pathParts asArray doWithIndex:
>       [:part :i |
>       s next: i put: $ .
>       s nextPutAll: part withBlanksTrimmed; cr]]!
>
>
>
>


--
_,,,^..^,,,_
best, Eliot


Carpe Squeak!