Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.1058.mcz
==================== Summary ====================
Name: Collections-mt.1058
Author: mt
Time: 6 December 2023, 1:18:51.582488 pm
UUID: 3c908f5b-b914-0e41-9363-6864544802c6
Ancestors: Collections-mt.1057
Complements Morphic-mt.2147. Removes (never ever used?) #stringhash.
=============== Diff against Collections-mt.1057 ===============
Item was added:
+ ----- Method: RunArray>>intervalsAndValuesDo: (in category 'enumerating') -----
+ intervalsAndValuesDo: aBlock
+ "Enumerate the receiver with an absolute representation for each run, which makes it useful for other scenarios compared to #runsAndValuesDo:."
+
+ | index |
+ index := 0.
+ self runsAndValuesDo: [:run :value |
+ aBlock
+ value: (index + 1 to: (index := index + run))
+ value: value].!
Item was removed:
- ----- Method: String>>stringhash (in category 'private') -----
- stringhash
-
- ^ self hash.
- !
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2147.mcz
==================== Summary ====================
Name: Morphic-mt.2147
Author: mt
Time: 4 December 2023, 11:09:57.559721 am
UUID: 5c8a57d5-9661-924a-8ced-db7bf5d4664a
Ancestors: Morphic-mt.2146
In object explorers, use a more compact representation for run-arrays.
Thanks to Christoph (ct) for the idea!
=============== Diff against Morphic-mt.2146 ===============
Item was added:
+ ----- Method: RunArray>>explorerContents (in category '*Morphic-Explorer') -----
+ explorerContents
+ "Instead of listing each element, choose a more compact representation like bags and sets do. Instead of #runsAndValuesDo:, choose an absolute representation of runs via #intervalsAndValuesDo:."
+
+ ^ Array new: self runs size streamContents: [:stream |
+ self intervalsAndValuesDo: [:interval :value |
+ stream nextPut: (ObjectExplorerWrapper
+ with: value
+ name: interval printString
+ model: self)]]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2146.mcz
==================== Summary ====================
Name: Morphic-mt.2146
Author: mt
Time: 4 December 2023, 10:41:12.878721 am
UUID: 0270eb19-334f-bf46-9eea-dadbeeb695e7
Ancestors: Morphic-mt.2145
Complements Collections-mt.1057 for object explorers:
- For bags, show number of occurances
- For sets, drop that serial number to not imply index-based access
=============== Diff against Morphic-mt.2145 ===============
Item was added:
+ ----- Method: Bag>>explorerContents (in category '*Morphic-Explorer') -----
+ explorerContents
+ "Show the receiver's contents in a compact way, similar to its #printString representation."
+
+ ^ self valuesAndCounts withKeysSortedSafely associations withIndexCollect: [:assoc :index |
+ ObjectExplorerWrapper
+ with: assoc key
+ name: assoc value "i.e., number of occasions" printString, '×'
+ model: self]!
Item was changed:
----- Method: Set>>explorerContents (in category '*Morphic-Explorer') -----
explorerContents
+ "Like dictionaries, indicate some human-readable sort order, yet refrain from showing a serial number to not imply index-based access."
^Array new: self size streamContents: [ :stream |
+ self sortedSafely do: [ :each |
- self do: [ :each |
stream nextPut: (
ObjectExplorerWrapper
with: each
+ name: '·' "i.e., no order, no index-based access"
- name: (stream position + 1) printString
model: self) ] ]!
Marcel Taeumel uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-mt.402.mcz
==================== Summary ====================
Name: CollectionsTests-mt.402
Author: mt
Time: 4 December 2023, 10:39:15.230721 am
UUID: c8085214-d1bb-4a48-8c38-31a52ca02a4e
Ancestors: CollectionsTests-ul.401
Complements Collections-mt.1057
=============== Diff against CollectionsTests-ul.401 ===============
Item was added:
+ ----- Method: BagTest>>testPrintString (in category 'tests') -----
+ testPrintString
+
+ | bag |
+ bag := Bag new.
+ bag add: '1' withOccurrences: 5.
+ bag add: '2' withOccurrences: 1.
+ bag add: '3' withOccurrences: 3.
+
+ self assert: 'a Bag(''1''->5 ''2''->1 ''3''->3)' equals: bag printString.!
Item was added:
+ ----- Method: SetTest>>testPrintString (in category 'tests') -----
+ testPrintString
+
+ | set |
+ set := Set new.
+ set add: 'Squeak'.
+ set add: ','.
+ set add: 'Hello'.
+
+ self assert: 'a Set('','' ''Hello'' ''Squeak'')' equals: set printString.!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.1057.mcz
==================== Summary ====================
Name: Collections-mt.1057
Author: mt
Time: 4 December 2023, 10:38:49.326721 am
UUID: 3da620a5-90b9-f542-b1ab-6785eda55837
Ancestors: Collections-ct.1056
Update elements-printing for hashed collections, i.e., bags, sets, dictionaries:
- For bags, choose the more compact way that dictionaries do
- For sets, sort contents like dictionaries do for keys
- For dictionaries, drop that trailing space
Thanks to Christoph (ct) for the ideas!
=============== Diff against Collections-ct.1056 ===============
Item was added:
+ ----- Method: Bag>>printElementsOn: (in category 'printing') -----
+ printElementsOn: aStream
+ "Pass request to internal contents dictionary to re-use its printString representation, which exposes (more compact) item counts and not a raw element list."
+
+ contents printElementsOn: aStream.!
Item was changed:
----- Method: Dictionary>>printElementsOn: (in category 'printing') -----
printElementsOn: aStream
aStream nextPut: $(.
self size > 100
ifTrue: [aStream nextPutAll: 'size '.
self size printOn: aStream]
ifFalse: [self keysInOrder
do: [:key | aStream print: key;
nextPutAll: '->';
+ print: (self at: key)]
+ separatedBy: [aStream space]].
- print: (self at: key);
- space]].
aStream nextPut: $)!
Item was added:
+ ----- Method: Set>>printElementsOn: (in category 'printing') -----
+ printElementsOn: aStream
+ "Like dictionaries, indicate some human-readable sort order."
+
+ self sortedSafely printElementsOn: aStream.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2145.mcz
==================== Summary ====================
Name: Morphic-mt.2145
Author: mt
Time: 4 December 2023, 9:10:32.014721 am
UUID: e96bb924-174b-e244-9121-10ca92e1bb6b
Ancestors: Morphic-ct.2144
In docking-bar menu's window-menu, adds icon for (older) close operations to better disinguish them besides the (newer) collapse/expand operations...assuming that "close" is the more frequently used one because of it being there for longer.
Note that having an icon for every menu item works against that pre-attentive effect of finding more quickly what you are looking for. This also works for, e.g., "one item below the one with that icon". Thus, no need for every entry in a menu to have an icon. Thus, only an icon for the close-operation, not collapse/expand, even though we have icons for that as well. Let's hope that this is a useful trade-off. :-)
=============== Diff against Morphic-ct.2144 ===============
Item was changed:
----- Method: TheWorldMainDockingBar>>windowMenuFor:on: (in category 'submenu - windows') -----
windowMenuFor: window on: menu
+
+ | closeBox closeBoxWidth |
+ closeBox := SystemWindow closeBoxImage.
+ closeBoxWidth := closeBox width.
+
menu
addItem: [ :item |
item
contents: 'Close' translated ;
+ icon: closeBox;
target: window;
selector: #closeBoxHit ];
addItem: [ :item |
item
contents: 'Expand (or contract)' translated ;
+ icon: (MenuIcons blankIconOfWidth: closeBoxWidth);
target: window;
selector: #expandBoxHit ];
addItem: [ :item |
item
contents: 'Collapse (or expand)' translated ;
+ icon: (MenuIcons blankIconOfWidth: closeBoxWidth);
target: window;
selector: #collapseOrExpand ];
addLine;
addItem: [ :item |
item
contents: 'Close all like this' translated ;
+ icon: closeBox;
target: self;
selector: #closeAllWindowsLike:;
arguments: { window } ];
addItem: [ :item |
item
contents: 'Close all but this' translated ;
+ icon: (MenuIcons blankIconOfWidth: closeBoxWidth);
target: self;
selector: #closeAllWindowsBut:;
arguments: { window } ];
addLine;
addItem: [ :item |
item
contents: 'Collapse all like this' translated ;
+ icon: (MenuIcons blankIconOfWidth: closeBoxWidth);
target: self;
selector: #collapseAllWindowsLike:;
arguments: { window } ];
addItem: [ :item |
item
contents: 'Collapse all but this' translated ;
+ icon: (MenuIcons blankIconOfWidth: closeBoxWidth);
target: self;
selector: #collapseAllWindowsBut:;
arguments: { window } ]!
Christoph Thiede uploaded a new version of Regex-Core to project The Trunk:
http://source.squeak.org/trunk/Regex-Core-ct.86.mcz
==================== Summary ====================
Name: Regex-Core-ct.86
Author: ct
Time: 1 December 2023, 9:03:54.138752 pm
UUID: 461b5d18-91be-b642-9a2d-d8e56e224948
Ancestors: Regex-Core-tpr.85
Replaces send to #asUnicode with #codePoint, as the former should only used in text conversion scenarios. Thanks to Marcel for the note.
=============== Diff against Regex-Core-tpr.85 ===============
Item was changed:
----- Method: RxsPredicate>>beUnicodeCategory: (in category 'initialize-release') -----
beUnicodeCategory: categoryName
| unicodeClass |
unicodeClass := self class unicodeClass.
self predicate: [:char |
+ (unicodeClass generalCategoryTagOf: char codePoint) beginsWith: categoryName].!
- (unicodeClass generalCategoryTagOf: char asUnicode) beginsWith: categoryName].!
Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2140.mcz
==================== Summary ====================
Name: Morphic-ct.2140
Author: ct
Time: 13 November 2023, 8:01:39.216583 pm
UUID: 4cbb521d-2842-aa44-8dd3-b174ff5bb437
Ancestors: Morphic-ct.2139
Proposal: Makes characters of strings explorable in object explorers. This seems an artificial limitation and I have used and appreciated this feature in the past for various string debugging tasks over the last few months.
I don't see any reason for this limitation. Is it about performance? If yes, the same problem exists for other types of collections as well, and we should address that separately. In my own experience, this wasn't an issue, though.
=============== Diff against Morphic-ct.2139 ===============
Item was removed:
- ----- Method: String>>hasContentsInExplorer (in category '*Morphic-Explorer') -----
- hasContentsInExplorer
-
- ^false!