Yes evil mutations! Let's ban these


2013/4/28 St�phane Ducasse <stephane.ducasse@inria.fr>
Thanks for the explanation but I do not get it

Because

shortcut1 := $a ctrl.
shortcut2 := $a ctrl shift

created different shortcuts.�

I thought you wanted the inverse:
You wrote:

Why modifiers change receiver state instead of create new instance?


And it is fully unexpected that I can not refactor it to:

shotcut2 := shortcut1 shift

ahhh I got it.


Because after that my shortcut1 become broken.

It was happen in TxTextMorph where selection and movement shortcuts created at same time

TxTextMorph>>moveEditorOn: aShortcut by: aSelector
���
��� self on: aShortcut do: [
��� ��� self moveEditorBy: aSelector withSelection: false ].
��� self on: selectionModeModifier + aShortcut� do: [
��� ��� self moveEditorBy: aSelector withSelection: true].

To fix it I add deep copy of given shortcut before modifier operation.

>
> There is another example:
>
> shortcut := $a ctrl.
> self assert: shortcut == (KMModifier shift + shortcut)
>
> Yes. Such operation modified argument of message #+. What the crapp! Why it not returns new instance?
>
> I hope you agree to change this behaviour
>
>