The Inbox: Collections-ct.853.mcz

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

The Inbox: Collections-ct.853.mcz

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

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

Name: Collections-ct.853
Author: ct
Time: 21 September 2019, 7:36:40.443935 pm
UUID: 627a4e03-54a2-9245-899e-62e983669d25
Ancestors: Collections-mt.851

Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter

Complements MorphicExtras-ct.261

=============== Diff against Collections-mt.851 ===============

Item was added:
+ ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
+ asSimpleGetter
+
+ self numArgs isZero ifTrue: [^ self].
+ self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
+ ^ self allButLast asSymbol!

Item was added:
+ ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
+ asSimpleSetter
+ ^ (self, ':') asSymbol!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.853.mcz

Christoph Thiede

By the way, when moving methods from package A to B, does the order of involved commits matter to you?


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Samstag, 21. September 2019 19:36:47
An: [hidden email]
Betreff: [squeak-dev] The Inbox: Collections-ct.853.mcz
 
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.853.mcz

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

Name: Collections-ct.853
Author: ct
Time: 21 September 2019, 7:36:40.443935 pm
UUID: 627a4e03-54a2-9245-899e-62e983669d25
Ancestors: Collections-mt.851

Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter

Complements MorphicExtras-ct.261

=============== Diff against Collections-mt.851 ===============

Item was added:
+ ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
+ asSimpleGetter
+
+        self numArgs isZero ifTrue: [^ self].
+        self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
+        ^ self allButLast asSymbol!

Item was added:
+ ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
+ asSimpleSetter
+        ^ (self, ':') asSymbol!




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

Re: The Inbox: Collections-ct.853.mcz

Levente Uzonyi
In reply to this post by commits-2
I still prefer #asSimpleSetter to do what #asMutator does now, as it was
in Patrick's change set[1], except for the method comment, which should
have the name updated.

Levente

[1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2019-August/203554.html

On Sat, 21 Sep 2019, [hidden email] wrote:

> A new version of Collections was added to project The Inbox:
> http://source.squeak.org/inbox/Collections-ct.853.mcz
>
> ==================== Summary ====================
>
> Name: Collections-ct.853
> Author: ct
> Time: 21 September 2019, 7:36:40.443935 pm
> UUID: 627a4e03-54a2-9245-899e-62e983669d25
> Ancestors: Collections-mt.851
>
> Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter
>
> Complements MorphicExtras-ct.261
>
> =============== Diff against Collections-mt.851 ===============
>
> Item was added:
> + ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
> + asSimpleGetter
> +
> + self numArgs isZero ifTrue: [^ self].
> + self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
> + ^ self allButLast asSymbol!
>
> Item was added:
> + ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
> + asSimpleSetter
> + ^ (self, ':') asSymbol!

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.853.mcz

Levente Uzonyi
In reply to this post by Christoph Thiede
On Sat, 21 Sep 2019, Thiede, Christoph wrote:

>
> By the way, when moving methods from package A to B, does the order of involved commits matter to you?

The updater should handle that once both versions are in the Trunk, but
I'd upload the package with the addition first.

Levente

>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
> Gesendet: Samstag, 21. September 2019 19:36:47
> An: [hidden email]
> Betreff: [squeak-dev] The Inbox: Collections-ct.853.mcz  
> A new version of Collections was added to project The Inbox:
> http://source.squeak.org/inbox/Collections-ct.853.mcz
>
> ==================== Summary ====================
>
> Name: Collections-ct.853
> Author: ct
> Time: 21 September 2019, 7:36:40.443935 pm
> UUID: 627a4e03-54a2-9245-899e-62e983669d25
> Ancestors: Collections-mt.851
>
> Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter
>
> Complements MorphicExtras-ct.261
>
> =============== Diff against Collections-mt.851 ===============
>
> Item was added:
> + ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
> + asSimpleGetter
> +
> +        self numArgs isZero ifTrue: [^ self].
> +        self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
> +        ^ self allButLast asSymbol!
>
> Item was added:
> + ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
> + asSimpleSetter
> +        ^ (self, ':') asSymbol!
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.853.mcz

marcel.taeumel
I think we should file-in Patrick's change set about that matter instead:

Best,
Marcel

Am 22.09.2019 01:52:34 schrieb Levente Uzonyi <[hidden email]>:

On Sat, 21 Sep 2019, Thiede, Christoph wrote:

>
> By the way, when moving methods from package A to B, does the order of involved commits matter to you?

The updater should handle that once both versions are in the Trunk, but
I'd upload the package with the addition first.

Levente

>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev im Auftrag von [hidden email]
> Gesendet: Samstag, 21. September 2019 19:36:47
> An: [hidden email]
> Betreff: [squeak-dev] The Inbox: Collections-ct.853.mcz  
> A new version of Collections was added to project The Inbox:
> http://source.squeak.org/inbox/Collections-ct.853.mcz
>
> ==================== Summary ====================
>
> Name: Collections-ct.853
> Author: ct
> Time: 21 September 2019, 7:36:40.443935 pm
> UUID: 627a4e03-54a2-9245-899e-62e983669d25
> Ancestors: Collections-mt.851
>
> Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter
>
> Complements MorphicExtras-ct.261
>
> =============== Diff against Collections-mt.851 ===============
>
> Item was added:
> + ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
> + asSimpleGetter
> +
> +        self numArgs isZero ifTrue: [^ self].
> +        self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
> +        ^ self allButLast asSymbol!
>
> Item was added:
> + ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
> + asSimpleSetter
> +        ^ (self, ':') asSymbol!
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.853.mcz

Christoph Thiede

This changeset sounds well, thanks for the link. However, am I wrong or does this changeset *not* provide a way to convert a setter back to a getter, as I proposed?


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 23. September 2019 11:31:54
An: Alan Grimes via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Collections-ct.853.mcz
 
I think we should file-in Patrick's change set about that matter instead:

Best,
Marcel

Am 22.09.2019 01:52:34 schrieb Levente Uzonyi <[hidden email]>:

On Sat, 21 Sep 2019, Thiede, Christoph wrote:

>
> By the way, when moving methods from package A to B, does the order of involved commits matter to you?

The updater should handle that once both versions are in the Trunk, but
I'd upload the package with the addition first.

Levente

>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev im Auftrag von [hidden email]
> Gesendet: Samstag, 21. September 2019 19:36:47
> An: [hidden email]
> Betreff: [squeak-dev] The Inbox: Collections-ct.853.mcz  
> A new version of Collections was added to project The Inbox:
> http://source.squeak.org/inbox/Collections-ct.853.mcz
>
> ==================== Summary ====================
>
> Name: Collections-ct.853
> Author: ct
> Time: 21 September 2019, 7:36:40.443935 pm
> UUID: 627a4e03-54a2-9245-899e-62e983669d25
> Ancestors: Collections-mt.851
>
> Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter
>
> Complements MorphicExtras-ct.261
>
> =============== Diff against Collections-mt.851 ===============
>
> Item was added:
> + ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
> + asSimpleGetter
> +
> +        self numArgs isZero ifTrue: [^ self].
> +        self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
> +        ^ self allButLast asSymbol!
>
> Item was added:
> + ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
> + asSimpleSetter
> +        ^ (self, ':') asSymbol!
>
>
>
>


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

Re: The Inbox: Collections-ct.853.mcz

marcel.taeumel
Yeah, Patrick should consider this, too. :-) At the moment, it's his issue, I suppose.

Maybe you could raise your concern about #asSimpleGetter and #isSimpleGetter in that discussion?

Best,
Marcel

Am 23.09.2019 16:16:36 schrieb Thiede, Christoph <[hidden email]>:

This changeset sounds well, thanks for the link. However, am I wrong or does this changeset *not* provide a way to convert a setter back to a getter, as I proposed?


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 23. September 2019 11:31:54
An: Alan Grimes via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Collections-ct.853.mcz
 
I think we should file-in Patrick's change set about that matter instead:

Best,
Marcel

Am 22.09.2019 01:52:34 schrieb Levente Uzonyi <[hidden email]>:

On Sat, 21 Sep 2019, Thiede, Christoph wrote:

>
> By the way, when moving methods from package A to B, does the order of involved commits matter to you?

The updater should handle that once both versions are in the Trunk, but
I'd upload the package with the addition first.

Levente

>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev im Auftrag von [hidden email]
> Gesendet: Samstag, 21. September 2019 19:36:47
> An: [hidden email]
> Betreff: [squeak-dev] The Inbox: Collections-ct.853.mcz  
> A new version of Collections was added to project The Inbox:
> http://source.squeak.org/inbox/Collections-ct.853.mcz
>
> ==================== Summary ====================
>
> Name: Collections-ct.853
> Author: ct
> Time: 21 September 2019, 7:36:40.443935 pm
> UUID: 627a4e03-54a2-9245-899e-62e983669d25
> Ancestors: Collections-mt.851
>
> Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter
>
> Complements MorphicExtras-ct.261
>
> =============== Diff against Collections-mt.851 ===============
>
> Item was added:
> + ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
> + asSimpleGetter
> +
> +        self numArgs isZero ifTrue: [^ self].
> +        self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
> +        ^ self allButLast asSymbol!
>
> Item was added:
> + ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
> + asSimpleSetter
> +        ^ (self, ':') asSymbol!
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.853.mcz

Levente Uzonyi
In reply to this post by Christoph Thiede
On Mon, 23 Sep 2019, Thiede, Christoph wrote:

>
> This changeset sounds well, thanks for the link. However, am I wrong or does this changeset *not* provide a way to convert a setter back to a getter, as I proposed?

That is correct.
I had a look at #asSimpleGetter and I don't think it should be written as
you did. Why?
- String >> #numArgs can return -1, which is not handled by the method
- String >> #numArgs is not cheap. Using it twice on one of the most
common paths (the argument is a simple setter) is a waste.
- It doesn't handle binary selectors, e.g. #~=

I would write something like this:

  self precedence
  caseOf: {
  [ 1 ] -> [ self numArgs = 0 ifTrue: [ ^self ] ].
  [ 3 ] -> [ self numArgs = 1 ifTrue: [ ^self allButLast asSymbol ] ] }
  otherwise: [].
  self error: 'only simple setters and getters can be converted to simple getters'.


Levente

>
>
> Best,
>
> Christoph
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Montag, 23. September 2019 11:31:54
> An: Alan Grimes via Squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: Collections-ct.853.mcz  
> I think we should file-in Patrick's change set about that matter instead: http://forum.world.st/The-Trunk-Collections-pre-822-mcz-td5097223.html
>
> Best,
> Marcel
>
>       Am 22.09.2019 01:52:34 schrieb Levente Uzonyi <[hidden email]>:
>
>       On Sat, 21 Sep 2019, Thiede, Christoph wrote:
>
>       >
>       > By the way, when moving methods from package A to B, does the order of involved commits matter to you?
>
>       The updater should handle that once both versions are in the Trunk, but
>       I'd upload the package with the addition first.
>
>       Levente
>
>       >
>       >_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
>       _
>       > Von: Squeak-dev im Auftrag von [hidden email]
>       > Gesendet: Samstag, 21. September 2019 19:36:47
>       > An: [hidden email]
>       > Betreff: [squeak-dev] The Inbox: Collections-ct.853.mcz  
>       > A new version of Collections was added to project The Inbox:
>       > http://source.squeak.org/inbox/Collections-ct.853.mcz
>       >
>       > ==================== Summary ====================
>       >
>       > Name: Collections-ct.853
>       > Author: ct
>       > Time: 21 September 2019, 7:36:40.443935 pm
>       > UUID: 627a4e03-54a2-9245-899e-62e983669d25
>       > Ancestors: Collections-mt.851
>       >
>       > Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter
>       >
>       > Complements MorphicExtras-ct.261
>       >
>       > =============== Diff against Collections-mt.851 ===============
>       >
>       > Item was added:
>       > + ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
>       > + asSimpleGetter
>       > +
>       > +        self numArgs isZero ifTrue: [^ self].
>       > +        self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
>       > +        ^ self allButLast asSymbol!
>       >
>       > Item was added:
>       > + ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
>       > + asSimpleSetter
>       > +        ^ (self, ':') asSymbol!
>       >
>       >
>       >
>       >
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.853.mcz

Christoph Thiede

> That is correct.
> I had a look at #asSimpleGetter and I don't think it should be written as
> you did. Why?
> - String >> #numArgs can return -1, which is not handled by the method
> - String >> #numArgs is not cheap. Using it twice on one of the most
> common paths (the argument is a simple setter) is a waste.
> - It doesn't handle binary selectors, e.g. #~=
> I would write something like this:
>          self precedence
>                  caseOf: {
>                          [ 1 ] -> [ self numArgs = 0 ifTrue: [ ^self ] ].
>                          [ 3 ] -> [ self numArgs = 1 ifTrue: [ ^self allButLast asSymbol ] ] }
>                  otherwise: [].
>          self error: 'only simple setters and getters can be converted to simple getters'.

+1, this is a much better implementation :)

Von: Squeak-dev <[hidden email]> im Auftrag von Levente Uzonyi <[hidden email]>
Gesendet: Montag, 23. September 2019 17:40:30
An: The general-purpose Squeak developers list
Cc: Squeak Dev
Betreff: Re: [squeak-dev] The Inbox: Collections-ct.853.mcz
 
On Mon, 23 Sep 2019, Thiede, Christoph wrote:

>
> This changeset sounds well, thanks for the link. However, am I wrong or does this changeset *not* provide a way to convert a setter back to a getter, as I proposed?

That is correct.
I had a look at #asSimpleGetter and I don't think it should be written as
you did. Why?
- String >> #numArgs can return -1, which is not handled by the method
- String >> #numArgs is not cheap. Using it twice on one of the most
common paths (the argument is a simple setter) is a waste.
- It doesn't handle binary selectors, e.g. #~=

I would write something like this:

         self precedence
                 caseOf: {
                         [ 1 ] -> [ self numArgs = 0 ifTrue: [ ^self ] ].
                         [ 3 ] -> [ self numArgs = 1 ifTrue: [ ^self allButLast asSymbol ] ] }
                 otherwise: [].
         self error: 'only simple setters and getters can be converted to simple getters'.


Levente

>
>
> Best,
>
> Christoph
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
> Gesendet: Montag, 23. September 2019 11:31:54
> An: Alan Grimes via Squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: Collections-ct.853.mcz  
> I think we should file-in Patrick's change set about that matter instead: http://forum.world.st/The-Trunk-Collections-pre-822-mcz-td5097223.html
>
> Best,
> Marcel
>
>       Am 22.09.2019 01:52:34 schrieb Levente Uzonyi <[hidden email]>:
>
>       On Sat, 21 Sep 2019, Thiede, Christoph wrote:
>
>       >
>       > By the way, when moving methods from package A to B, does the order of involved commits matter to you?
>
>       The updater should handle that once both versions are in the Trunk, but
>       I'd upload the package with the addition first.
>
>       Levente
>
>       >
>       >_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
>       _
>       > Von: Squeak-dev im Auftrag von [hidden email]
>       > Gesendet: Samstag, 21. September 2019 19:36:47
>       > An: [hidden email]
>       > Betreff: [squeak-dev] The Inbox: Collections-ct.853.mcz  
>       > A new version of Collections was added to project The Inbox:
>       > http://source.squeak.org/inbox/Collections-ct.853.mcz
>       >
>       > ==================== Summary ====================
>       >
>       > Name: Collections-ct.853
>       > Author: ct
>       > Time: 21 September 2019, 7:36:40.443935 pm
>       > UUID: 627a4e03-54a2-9245-899e-62e983669d25
>       > Ancestors: Collections-mt.851
>       >
>       > Move #asSimpleSetter from MorphicExtras to Collections (step 2/2) and supplement it by #asSimpleGetter
>       >
>       > Complements MorphicExtras-ct.261
>       >
>       > =============== Diff against Collections-mt.851 ===============
>       >
>       > Item was added:
>       > + ----- Method: Symbol>>asSimpleGetter (in category 'converting') -----
>       > + asSimpleGetter
>       > +
>       > +        self numArgs isZero ifTrue: [^ self].
>       > +        self numArgs > 1 ifTrue: [self error: 'Cannot convert complex selector to getter'].
>       > +        ^ self allButLast asSymbol!
>       >
>       > Item was added:
>       > + ----- Method: Symbol>>asSimpleSetter (in category 'converting') -----
>       > + asSimpleSetter
>       > +        ^ (self, ':') asSymbol!
>       >
>       >
>       >
>       >
>
>
>


Carpe Squeak!