Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.872.mcz
==================== Summary ====================
Name: Collections-ul.872
Author: ul
Time: 4 February 2020, 1:26:07.104018 pm
UUID: 735423f6-6dbb-4f4a-b2a7-f311cc7e8806
Ancestors: Collections-nice.870
Various performance tweaks in a single commit:
- be straightforward in Dictionary >> #fillFrom:with:
- when aCollection is a Dictionary use #associationsDo:, as it very likely it has associations, and it's faster than #keysAndValuesDo:
- when it's not a Dictionary, use #do: instead of #associationsDo:, because the former is what we can expect a Collection to implement
- use existing search methods in String >> #findDelimiters:startingAt:, because those are faster, and there's no need to reinvent the wheel. All users other than #findTokens:* should be rewritten to use #indexOfAnyOf:* instead.
- almost twice as fast (amortized cost) Symbol >> #lookup: for existing symbols
(Same as Collections-ul.869 in the Treated Inbox but with updated Trunk ancestry.)
=============== Diff against Collections-nice.870 ===============
Item was changed:
----- Method: Dictionary>>fillFrom:with: (in category 'private') -----
fillFrom: aCollection with: aBlock
"Evaluate aBlock with each of aCollections's elements as the argument.
Collect the resulting values into self. Answer self."
aCollection isDictionary
+ ifFalse: [
+ aCollection do: [ :element |
+ self add: (aBlock value: element) ] ]
+ ifTrue: [
+ aCollection associationsDo: [ :association |
+ self at: association key put: (aBlock value: association value) ] ]!
- ifFalse:
- [aCollection associationsDo:
- [ :element | self add: (aBlock value: element)]]
- ifTrue:
- [aCollection keysAndValuesDo:
- [ :key :value | self at: key put: (aBlock value: value)]]!
Item was changed:
----- Method: String>>findDelimiters:startingAt: (in category 'accessing') -----
findDelimiters: delimiters startingAt: start
"Answer the index of the character within the receiver, starting at start, that matches one of the delimiters. If the receiver does not contain any of the delimiters, answer size + 1."
+ delimiters size = 1 ifTrue: [ ^self indexOf: delimiters anyOne startingAt: start ifAbsent: self size + 1 ].
+ ^self indexOfAnyOf: delimiters startingAt: start ifAbsent: self size + 1!
- start to: self size do: [:i |
- delimiters do: [:delim | delim = (self at: i) ifTrue: [^ i]]].
- ^ self size + 1!
Item was changed:
----- Method: Symbol class>>lookup: (in category 'instance creation') -----
lookup: aStringOrSymbol
| originalNewSymbols originalSymbolTable |
originalNewSymbols := NewSymbols.
originalSymbolTable := SymbolTable.
+ ^(originalSymbolTable like: aStringOrSymbol) ifNil: [
+ originalNewSymbols like: aStringOrSymbol ]!
- ^(originalNewSymbols like: aStringOrSymbol) ifNil: [
- originalSymbolTable like: aStringOrSymbol ]!
Hi all,
here's another input handling bug, this one might be specific to macOS:
Open a workspace, then press `option + command + ]` (on a US keyboard).
This will trigger the following debugger:
[image: image.png]
Best,
Fabio
Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1623.mcz
==================== Summary ====================
Name: Morphic-ct.1623
Author: ct
Time: 1 February 2020, 1:49:06.372633 pm
UUID: 2e64e67e-c69c-4041-a9cc-8925d9335986
Ancestors: Morphic-cmm.1618
Proposal: Add logic to remove all morphic alarms of a receiver
I like to use this method in #delete of custom Morph classes. It's often easier than looking up all senders of #addAlarm:* to find out the exact selectors of the alarms to remove ...
=============== Diff against Morphic-cmm.1618 ===============
Item was added:
+ ----- Method: Morph>>removeAlarms (in category 'events-alarms') -----
+ removeAlarms
+
+ self alarmScheduler ifNotNil: [:scheduler |
+ scheduler removeAlarmsFor: self].!
Item was added:
+ ----- Method: MorphicAlarmQueue>>removeAlarmsWithReceiver: (in category 'removing') -----
+ removeAlarmsWithReceiver: receiver
+
+ ^ heap removeAllSuchThat: [ :each | each receiver == receiver ]!
Item was added:
+ ----- Method: PasteUpMorph>>removeAlarmsFor: (in category 'alarms-scheduler') -----
+ removeAlarmsFor: aTarget
+ worldState removeAlarmsFor: aTarget!
Item was added:
+ ----- Method: WorldState>>removeAlarmsFor: (in category 'alarms') -----
+ removeAlarmsFor: aTarget
+ self lockAlarmsDuring: [:locked |
+ locked removeAlarmsWithReceiver: aTarget ]!
Steps to reproduce:
Debug it:
self halt.
Inspect the Debugger model and do it:
(RunArray runs: #(2 1 1 3 3 2 1 4) values: #(#stepInto #stepOver #stepInto #stepOver #stepInto #stepOver #stepInto #stepOver))
do: [:each | self in: each].
Expected behavior:
The debugger shows the last step of UnhandledError class>>signalForException:.
Actual behavior:
A second debugger appears on the same process, showing UndefinedObject(Object)>>halt.
Notes:
None of my two proposals on how to fix the infinite debugger chains<http://forum.world.st/I-broke-the-debugger-tp5110752p5110814.html> affects this behavior. There must be some other magic ...
Best,
Christoph