Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.739.mcz
==================== Summary ====================
Name: Collections-ul.739
Author: ul
Time: 28 February 2017, 7:34:55.711173 pm
UUID: 66c6ecf2-71bf-4e7d-80e6-5ace72fa19ba
Ancestors: Collections-ul.738
- use micro optimization for #~~ and #notNil in common collection methods
- reuse one of the OrderedCollections in RunArray >> #scanFrom:
- two other minor tweaks in KeyedSet
- removed accidentally commited Set >> #includes2:
=============== Diff against Collections-ul.738 ===============
Item was changed:
----- Method: Dictionary>>includesKey: (in category 'testing') -----
includesKey: key
"Answer whether the receiver has a key equal to the argument, key."
+ (array at: (self scanFor: key)) ifNil: [ ^false ] ifNotNil: [ ^true ]!
- ^(array at: (self scanFor: key)) notNil!
Item was changed:
----- Method: KeyedSet>>includesKey: (in category 'testing') -----
includesKey: key
+ (array at: (self scanFor: key)) ifNil: [ ^false ] ifNotNil: [ ^true ]!
- ^ (array at: (self scanFor: key)) notNil!
Item was changed:
----- Method: KeyedSet>>remove:ifAbsent: (in category 'removing') -----
remove: oldObject ifAbsent: aBlock
| index |
index := self scanFor: (keyBlock value: oldObject).
+ (array at: index) ifNil: [ ^ aBlock value ].
- (array at: index) == nil ifTrue: [ ^ aBlock value ].
array at: index put: nil.
tally := tally - 1.
self fixCollisionsFrom: index.
^ oldObject!
Item was changed:
----- Method: KeyedSet>>removeKey:ifAbsent: (in category 'removing') -----
removeKey: key ifAbsent: aBlock
| index obj |
index := self scanFor: key.
+ obj := (array at: index) ifNil: [ ^ aBlock value ].
- (obj := array at: index) == nil ifTrue: [ ^ aBlock value ].
array at: index put: nil.
tally := tally - 1.
self fixCollisionsFrom: index.
^ obj enclosedSetElement!
Item was changed:
----- Method: RunArray class>>scanFrom: (in category 'instance creation') -----
scanFrom: strm
"Read the style section of a fileOut or sources file. nextChunk has already been done. We need to return a RunArray of TextAttributes of various kinds. These are written by the implementors of writeScanOn:"
| runs values attrList char |
(strm peekFor: $( ) ifFalse: [^ nil].
runs := OrderedCollection new.
[strm skipSeparators.
strm peekFor: $)] whileFalse:
[runs add: (Number readFrom: strm)].
values := OrderedCollection new. "Value array"
attrList := OrderedCollection new. "Attributes list"
[(char := strm peek) == nil] whileFalse: [
(char isSeparator or: [ char = $!! ])
ifTrue: [ "n.b. Skip $!! to meet expectations of RunArrayTest>>testScanFromTrailer.
The example string used in that test does not seem to match the implemention
of the fileOut serialization, but the test may be right and the implementation
wrong. In any case, relax the parsing here to meet the test expectations, and to
be more consistent with the original version of this method that assumed any
unexpected charater to be a separator. -dtl Jan 2014"
strm next "space, cr do nothing"]
ifFalse: [char == $,
ifTrue: [strm next.
values add: attrList asArray.
+ attrList reset ]
- attrList := OrderedCollection new]
ifFalse: [attrList add: (TextAttribute newFrom: strm)]
]
].
values add: attrList asArray.
^ self runs: runs asArray values: (values copyFrom: 1 to: runs size) asArray
"
RunArray scanFrom: (ReadStream on: '(14 50 312)f1,f1b,f1LInteger +;i')
"!
Item was removed:
- ----- Method: Set>>includes2: (in category 'testing') -----
- includes2: anObject
-
- ^((array at: (self scanFor: anObject)) == nil) not!
Item was changed:
----- Method: WeakIdentityDictionary>>includesKey: (in category 'testing') -----
includesKey: key
"Answer whether the receiver has a key equal to the argument, key."
+ (array at: (self scanFor: key))
+ ifNil: [
+ "it just has been reclaimed"
+ ^false]
+ ifNotNil: [ :element |
+ element == vacuum
+ ifTrue: [ ^false ]
+ ifFalse: [ ^true ] ]!
- ^(array at: (self scanFor: key))
- ifNil:
- ["it just has been reclaimed"
- false]
- ifNotNil: [:element | element ~~ vacuum]!
Item was changed:
----- Method: WeakSet>>includes: (in category 'testing') -----
includes: anObject
(array at: (self scanFor: anObject))
ifNil: [ ^false ]
+ ifNotNil: [ :object |
+ object == flag
+ ifTrue: [ ^false ]
+ ifFalse: [ ^true ] ]!
- ifNotNil: [ :object | ^object ~~ flag ]!
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.744.mcz
==================== Summary ====================
Name: Tools-cmm.744
Author: cmm
Time: 27 February 2017, 2:57:13.398974 pm
UUID: 494d1583-1885-43b9-93ed-9aff5b4c3b1e
Ancestors: Tools-ul.743
Allow unfiltering of the message list even when no method is selected, via the message category toggle key (Command+Y).
=============== Diff against Tools-ul.743 ===============
Item was changed:
----- Method: Browser>>showHomeCategory (in category 'message category functions') -----
showHomeCategory
+ "Select the category of the currently-selected method. If it is already selected, or if no method is selected, deselect it to unfilter the message list."
- "Show the home category of the selected method. This is only really useful if one is in a tool that supports the showing of categories. Thus, it's good in browsers and hierarchy browsers but not in message-list browsers"
-
- | aSelector |
self okToChange ifTrue:
+ [ | aSelector | ((aSelector := self selectedMessageName) notNil or: [ selectedMessageCategoryName notNil ]) ifTrue:
+ [ aSelector
+ ifNil: [ self selectMessageCategoryNamed: nil ]
+ ifNotNil: [ self toggleCategorySelectionForCurrentMethod ].
+ self selectedMessageName: aSelector ] ]!
- [(aSelector := self selectedMessageName) ifNotNil:
- [self toggleCategorySelectionForCurrentMethod.
- self selectedMessageName: aSelector]]!
Item was changed:
----- Method: CodeHolder>>messageListKey:from: (in category 'message list menu') -----
messageListKey: aChar from: view
"Respond to a Command key. I am a model with a code pane, and I also
have a listView that has a list of methods. The view knows how to get
the list and selection."
| sel class |
aChar == $D ifTrue: [^ self toggleDiffing].
sel := self selectedMessageName.
aChar == $m ifTrue: "These next two put up a type in if no message selected"
[^ self useSelector: sel orGetSelectorAndSendQuery: #browseAllImplementorsOf: to: self ].
aChar == $n ifTrue:
[^ self useSelector: sel orGetSelectorAndSendQuery: #browseAllCallsOn: to: self ].
aChar == $d ifTrue: [^ self removeMessageFromBrowser].
"The following require a class selection"
(class := self selectedClassOrMetaClass) ifNil: [^ self arrowKey: aChar from: view].
aChar == $b ifTrue: [^ ToolSet browse: class selector: sel].
aChar == $N ifTrue: [^ self browseClassRefs].
aChar == $i ifTrue: [^ self methodHierarchy].
aChar == $h ifTrue: [^ self classHierarchy].
aChar == $p ifTrue: [^ self browseFullProtocol].
aChar == $r ifTrue: [^ self browseVariableReferences].
aChar == $a ifTrue: [^ self browseVariableAssignments].
+ (aChar == $Y and: [self canShowMultipleMessageCategories])
+ ifTrue: [^ self showHomeCategory].
"The following require a method selection"
sel ifNotNil:
[aChar == $o ifTrue: [^ self fileOutMessage].
aChar == $c ifTrue: [^ self copySelector].
aChar == $v ifTrue: [^ self browseVersions].
aChar == $x ifTrue: [^ self removeMessage].
+ aChar == $C ifTrue: [ self copyReference ]].
- aChar == $C ifTrue: [ self copyReference ].
- (aChar == $Y and: [self canShowMultipleMessageCategories])
- ifTrue: [^ self showHomeCategory]].
^ self arrowKey: aChar from: view!
Levente Uzonyi uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-ul.280.mcz
==================== Summary ====================
Name: EToys-ul.280
Author: ul
Time: 27 February 2017, 1:34:44.128483 pm
UUID: 29c41958-b162-47d6-8457-704818377065
Ancestors: EToys-ul.279
KOI8RTextConverter takes into account the installed line end convention when it's encoding characters.
This fixes the failing #testLineEndConversion.
The converter seems to be a ByteTextConverter, but since I wouldn't be able to tell if it works or not if I were to change it, I decided to leave it as it is.
=============== Diff against EToys-ul.279 ===============
Item was changed:
----- Method: KOI8RTextConverter>>nextPut:toStream: (in category 'as yet unclassified') -----
nextPut: aCharacter toStream: aStream
+ | charCode |
+ aStream isBinary ifTrue: [ ^aCharacter storeBinaryOn: aStream ].
+ (charCode := aCharacter charCode) < 256
+ ifFalse: [ aStream basicNextPut: ((Character value: (self fromSqueak: aCharacter) charCode)) ]
+ ifTrue: [
+ (latin1Encodings at: charCode + 1)
+ ifNil: [ aStream basicNextPut: aCharacter ]
+ ifNotNil: [ :encodedString | aStream basicNextPutAll: encodedString ] ].
+ ^aCharacter
- aStream isBinary ifTrue: [^aCharacter storeBinaryOn: aStream].
- aCharacter charCode < 128 ifTrue: [
- aStream basicNextPut: aCharacter.
- ] ifFalse: [
- aStream basicNextPut: ((Character value: (self fromSqueak: aCharacter) charCode)).
- ].
!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.926.mcz
==================== Summary ====================
Name: System-ul.926
Author: ul
Time: 27 February 2017, 2:25:48.914916 am
UUID: e86b75db-f12d-4172-b640-4574322ea818
Ancestors: System-dtl.925
- omit ifAbsent from #index* sends when the default value, 0 would used
=============== Diff against System-dtl.925 ===============
Item was changed:
----- Method: SmalltalkImage>>renamedClass:from:to: (in category 'classes and traits') -----
renamedClass: aClass from: oldName to: newName
"Inform Smalltalk that aClass has been renamed"
(Array with: StartUpList with: ShutDownList) do:[:list | | index |
+ index := list indexOf: oldName.
- index := list indexOf: oldName ifAbsent: [0].
index > 0 ifTrue: [list at: index put: newName].
].
!