Levente Uzonyi uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-ul.168.mcz
==================== Summary ====================
Name: Files-ul.168
Author: ul
Time: 14 March 2017, 1:27:42.470961 am
UUID: ce489769-10b9-48e5-bc6f-86ee3a5a5eb4
Ancestors: Files-ul.167
- reverted some of the recent changes, because they may not work on other platforms
=============== Diff against Files-ul.167 ===============
Item was changed:
----- Method: DirectoryEntryDirectory>>asFileDirectory (in category 'convert') -----
asFileDirectory
"Answer a FileDirectory representing the same directory I represent."
+
+ ^directory on: (directory fullNameFor: name)!
-
- ^directory on: name!
Item was changed:
----- Method: FileDirectory>>directoryEntryForName: (in category 'private') -----
directoryEntryForName: aFileName
"Return a single DirectoryEntry for the given (non-path) entry name,
or nil if the entry could not be found.
Raises InvalidDirectoryError if this directory's path does not identify a directory."
| entryArray sysPath sysName |
sysPath := pathName asVmPathName.
sysName := aFileName asVmPathName.
"New linear-time primitive."
entryArray := self primLookupEntryIn: sysPath name: sysName.
entryArray == #primFailed ifFalse:[
^ entryArray ifNotNil: [(DirectoryEntry fromArray: entryArray directory: self) convertFromSystemName]
].
+ "(InvalidDirectoryError pathName: pathName) signal.
+ ^nil"
- (InvalidDirectoryError pathName: pathName) signal.
- ^nil
"If the new primitive fails, use the old slow method.
(This fallback can be changed to signal InvalidDirectoryError once
VM's with FilePlugin #primitiveDirectoryEntry have been distributed everywhere;
+ the new primitive was introduced 6/13/2007."
- the new primitive was introduced 6/13/2007.
self isCaseSensitive
ifTrue: [ self entriesDo: [ :entry | entry name = aFileName ifTrue: [ ^entry ] ] ]
ifFalse: [ self entriesDo: [ :entry | (entry name sameAs: aFileName) ifTrue: [ ^entry ] ] ].
+ ^nil!
- ^nil"!
Item was changed:
----- Method: FileDirectory>>fileOrDirectoryExists: (in category 'file operations') -----
fileOrDirectoryExists: filenameOrPath
"Answer true if either a file or a directory file of the given name exists. The given name may be either a full path name or a local name within this directory."
"FileDirectory default fileOrDirectoryExists: Smalltalk sourcesName"
| fName dir |
DirectoryClass splitName: filenameOrPath to:
[:filePath :name |
fName := name.
filePath isEmpty
ifTrue: [dir := self]
ifFalse: [dir := FileDirectory on: filePath]].
+ ^ (dir includesKey: fName) or: [ fName = '' and:[ dir entries size > 1]]!
- ^(dir includesKey: fName) or: [ fName = '' and: [ dir hasEntries ] ]!
Levente Uzonyi uploaded a new version of UpdateStream to project The Trunk:
http://source.squeak.org/trunk/UpdateStream-ul.9.mcz
==================== Summary ====================
Name: UpdateStream-ul.9
Author: ul
Time: 13 March 2017, 3:33:44.46675 pm
UUID: 851a813c-a1cf-4757-92d2-fec2489f1cdf
Ancestors: UpdateStream-pre.8
SortedCollection Whack-a-mole
=============== Diff against UpdateStream-pre.8 ===============
Item was changed:
----- Method: FileList>>putUpdate: (in category '*UpdateStream') -----
putUpdate: fullFileName
"Put this file out as an Update on the servers."
| names choice |
self canDiscardEdits ifFalse: [^ self changed: #flash].
+ names := ServerDirectory groupNames.
- names := ServerDirectory groupNames asSortedArray.
choice := UIManager default chooseFrom: names values: names.
choice == nil ifTrue: [^ self].
(ServerDirectory serverInGroupNamed: choice) putUpdate:
(directory oldFileNamed: fullFileName).
self volumeListIndex: volListIndex.
!
Item was changed:
----- Method: ServerDirectory class>>groupNames (in category '*UpdateStream-server groups') -----
groupNames
"Return the names of all registered groups of servers, including individual servers not in any group."
"ServerDirectory groupNames"
| names |
names := Set new.
self servers do: [:server |
names add: server groupName].
+ ^names sorted
- ^names asSortedArray
!
Item was changed:
----- Method: ServerDirectory>>updateInstallVersion: (in category '*UpdateStream-updating') -----
updateInstallVersion: newVersion
"For each server group, ask whether we want to put the new version marker (eg 'Squeak2.3') at the end of the file. Current version of Squeak must be the old one when this is done.
ServerDirectory new updateInstallVersion: 'Squeak9.9test'
"
| myServers updateStrm names choice indexPrefix listContents version versIndex |
+ [names := ServerDirectory groupNames.
- [names := ServerDirectory groupNames asSortedArray.
choice := UIManager default chooseFrom: names values: names.
choice == nil]
whileFalse:
[indexPrefix := (choice endsWith: '*')
ifTrue: [(choice findTokens: ' ') first] "special for internal updates"
ifFalse: ['']. "normal"
myServers := (ServerDirectory serverInGroupNamed: choice)
checkServersWithPrefix: indexPrefix
andParseListInto: [:x | listContents := x].
myServers size = 0 ifTrue: [^ self].
version := SystemVersion current version.
versIndex := (listContents collect: [:pair | pair first]) indexOf: version.
versIndex = 0 ifTrue:
[^ self inform: 'There is no section in updates.list for your version']. "abort"
"Append new version to updates following my version"
listContents := listContents copyReplaceFrom: versIndex+1 to: versIndex with: {{newVersion. {}}}.
updateStrm := ReadStream on:
(String streamContents: [:s | UpdateStreamDownloader default writeList: listContents toStream: s]).
myServers do:
[:aServer | updateStrm reset.
aServer putFile: updateStrm named: indexPrefix ,'updates.list'.
Transcript cr; show: indexPrefix ,'updates.list written on server ', aServer moniker].
self closeGroup]!
Item was changed:
----- Method: UpdateStreamDownloader class>>broadcastUpdatesFrom:to:except: (in category 'fetching updates') -----
broadcastUpdatesFrom: n1 to: n2 except: skipList
"
Note: This method takes its list of files from the directory named 'updates',
which will have been created and filled by, eg,
UpdateStreamDownloader readServerUpdatesSaveLocally: true updateImage: true.
These can then be rebroadcast to any server using, eg,
UpdateStreamDownloader broadcastUpdatesFrom: 1 to: 9999 except: #(223 224).
If the files are already on the server, and it is only a matter
of copying them to the index for a different version, then use...
(ServerDirectory serverInGroupNamed: 'SqC Internal Updates*')
exportUpdatesExcept: #().
"
+ | fileNames names choice file updateDirectory |
- | fileNames fileNamesInOrder names choice file updateDirectory |
updateDirectory := FileDirectory default directoryNamed: 'updates'.
fileNames := updateDirectory fileNames select:
[:n | n first isDigit
and: [(n initialIntegerOrNil between: n1 and: n2)
and: [(skipList includes: n initialIntegerOrNil) not]]].
(file := fileNames select: [:n | (n occurrencesOf: $.) > 1]) size > 0
ifTrue: [self halt: file first , ' has multiple periods'].
+ fileNames sort:
- fileNamesInOrder := fileNames asSortedCollection:
[:a :b | a initialIntegerOrNil < b initialIntegerOrNil].
+ names := ServerDirectory groupNames.
- names := ServerDirectory groupNames asSortedArray.
choice := UIManager default chooseFrom: names values: names.
choice == nil ifTrue: [^ self].
(ServerDirectory serverInGroupNamed: choice)
+ putUpdateMulti: fileNames fromDirectory: updateDirectory
- putUpdateMulti: fileNamesInOrder fromDirectory: updateDirectory
!
Item was changed:
----- Method: UpdateStreamDownloader class>>fileInFromUpdatesFolder: (in category 'fetching updates') -----
fileInFromUpdatesFolder: numberList
"File in a series of updates with the given updates numbers, from the updates folder in the default directory. The file-ins are done in numeric order, even if numberList was not sorted upon entry.
This is useful for test-driving the retrofitting of a possibly discontinguous list of updates from an alpha version back to a stable release.
UpdateStreamDownloader fileInFromUpdatesFolder: #(4745 4746 4747 4748 4749 4750 4751 4752 4754 4755 4761 4762 4767 4769).
"
+ | fileNames file updateDirectory |
- | fileNames fileNamesInOrder file updateDirectory |
updateDirectory := FileDirectory default directoryNamed: 'updates'.
fileNames := updateDirectory fileNames select:
[:n | n first isDigit
and: [numberList includes: n initialIntegerOrNil]].
(file := fileNames select: [:n | (n occurrencesOf: $.) > 1]) size > 0
ifTrue: [self error: file first , ' has multiple periods'].
+ fileNames sort:
- fileNamesInOrder := fileNames asSortedCollection:
[:a :b | a initialIntegerOrNil < b initialIntegerOrNil].
+ fileNames do:
- fileNamesInOrder do:
[:aFileName | (updateDirectory readOnlyFileNamed: aFileName) fileIntoNewChangeSet]!
Item was changed:
----- Method: UpdateStreamDownloader class>>summariesForUpdates:through: (in category 'fetching updates') -----
summariesForUpdates: startNumber through: stopNumber
"Answer the concatenation of summary strings for updates numbered in the given range"
^ String streamContents: [:aStream |
((ChangeSet changeSetsNamedSuchThat:
[:aName | aName first isDigit
and: [aName initialIntegerOrNil >= startNumber
+ and: [aName initialIntegerOrNil <= stopNumber]]]) sorted:
- and: [aName initialIntegerOrNil <= stopNumber]]]) asSortedCollection:
[:a :b | a name < b name]) do:
[:aChangeSet | aStream cr; nextPutAll: aChangeSet summaryString]]
"UpdateStreamDownloader summariesForUpdates: 4899 through: 4903"
!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.932.mcz
==================== Summary ====================
Name: System-ul.932
Author: ul
Time: 13 March 2017, 3:10:17.453603 pm
UUID: 7a305614-9a4b-47f8-a68f-79fcf6f90a80
Ancestors: System-eem.931
- SortedCollection Whack-a-mole
- introduced #classVarNames and #classInstVarNames in PseudoClass, because they had senders
- removed #startTimerInterruptWatcher from messages to keep lists
=============== Diff against System-eem.931 ===============
Item was changed:
----- Method: ChangeSet class>>traitsOrder: (in category 'fileIn/Out') -----
traitsOrder: aCollection
"Answer an OrderedCollection. The traits
are ordered so they can be filed in."
+ ^aCollection sorted: [:t1 :t2 |
- | traits |
- traits := aCollection asSortedCollection: [:t1 :t2 |
(t1 isBaseTrait and: [t1 classTrait == t2]) or: [
(t2 traitComposition allTraits includes: t1) or: [
+ (t1 traitComposition allTraits includes: t2) not]]]!
- (t1 traitComposition allTraits includes: t2) not]]].
- ^traits asArray!
Item was changed:
----- Method: ChangeSet>>changedMessageList (in category 'method changes') -----
changedMessageList
"Used by a message set browser to access the list view information."
| messageList |
messageList := OrderedCollection new.
changeRecords associationsDo: [:clAssoc | | classNameInParts classNameInFull |
classNameInFull := clAssoc key asString.
classNameInParts := classNameInFull findTokens: ' '.
(clAssoc value allChangeTypes includes: #comment) ifTrue:
[messageList add:
(MethodReference new
setClassSymbol: classNameInParts first asSymbol
classIsMeta: false
methodSymbol: #Comment
stringVersion: classNameInFull, ' Comment')].
clAssoc value methodChangeTypes associationsDo: [:mAssoc |
(#(remove addedThenRemoved) includes: mAssoc value) ifFalse:
[messageList add:
(MethodReference new
setClassSymbol: classNameInParts first asSymbol
classIsMeta: classNameInParts size > 1
methodSymbol: mAssoc key
stringVersion: classNameInFull, ' ' , mAssoc key)]]].
+ ^ messageList sort!
- ^ messageList asSortedArray!
Item was changed:
----- Method: ChangeSet>>checkForUncommentedClasses (in category 'fileIn/Out') -----
checkForUncommentedClasses
"Check to see if any classes involved in this change set do not have class comments. Open up a browser showing all such classes."
| aList |
aList := self changedClasses
select:
[:aClass | aClass theNonMetaClass organization classComment isEmptyOrNil]
thenCollect:
[:aClass | aClass theNonMetaClass name].
aList size > 0
ifFalse:
[^ self inform: 'All classes involved in this change set have class comments']
ifTrue:
+ [ToolSet openClassListBrowser: aList asSet sorted title: 'Classes in Change Set ', self name, ': classes that lack class comments']!
- [ToolSet openClassListBrowser: aList asSet asSortedArray title: 'Classes in Change Set ', self name, ': classes that lack class comments']!
Item was changed:
----- Method: ChangeSet>>fileOutOn: (in category 'fileIn/Out') -----
fileOutOn: stream
"Write out all the changes the receiver knows about"
| classList traits classes traitList list |
(self isEmpty and: [stream isKindOf: FileStream])
ifTrue: [self inform: 'Warning: no changes to file out'].
traits := self changedClasses reject: [:each | each isBehavior].
classes := self changedClasses select: [:each | each isBehavior].
traitList := self class traitsOrder: traits asOrderedCollection.
classList := self class superclassOrder: classes asOrderedCollection.
list := OrderedCollection new
addAll: traitList;
addAll: classList;
yourself.
"First put out rename, max classDef and comment changes."
list do: [:aClass | self fileOutClassDefinition: aClass on: stream].
"Then put out all the method changes"
list do: [:aClass | self fileOutChangesFor: aClass on: stream].
"Finally put out removals, final class defs and reorganization if any"
list reverseDo: [:aClass | self fileOutPSFor: aClass on: stream].
+ self classRemoves sort do:
- self classRemoves asSortedCollection do:
[:aClassName | stream nextChunkPut: 'Smalltalk removeClassNamed: #', aClassName; cr].!
Item was changed:
----- Method: InternalTranslator>>fileOutOn:keys:withBOM: (in category 'fileIn/fileOut') -----
fileOutOn: aStream keys: keys withBOM: bomFlag
"self current fileOutOn: Transcript. Transcript endEntry"
self fileOutHeaderOn: aStream withBOM: bomFlag.
(keys
+ ifNil: [generics keys sort])
- ifNil: [generics keys asSortedCollection])
do: [:key | self
nextChunkPut: (generics associationAt: key)
on: aStream].
keys
ifNil: [self untranslated
do: [:each | self nextChunkPut: each -> '' on: aStream]].
aStream nextPut: $!!;
cr!
Item was changed:
----- Method: MczInstaller>>install (in category 'installation') -----
install
+
- | sources |
zip := ZipArchive new.
zip readFrom: stream.
self checkDependencies ifFalse: [^false].
self recordVersionInfo.
+ (zip membersMatching: 'snapshot/*')
+ sort: [:a :b | a fileName < b fileName];
+ do: [:src | self installMember: src].!
- sources := (zip membersMatching: 'snapshot/*')
- asSortedCollection: [:a :b | a fileName < b fileName].
- sources do: [:src | self installMember: src].!
Item was changed:
----- Method: Preferences class>>giveHelpWithPreferences (in category 'support') -----
giveHelpWithPreferences
"Open up a workspace with explanatory info in it about Preferences"
| aString |
aString := String streamContents: [:aStream |
aStream nextPutAll:
'Many aspects of the system are governed by the settings of various "Preferences".
Click on any of brown tabs at the top of the panel to see all the preferences in that category.
Or type in to the box above the Search button, then hit Search, and all Preferences matching whatever you typed in will appear in the "search results" category. A preference is considered to match your search if either its name matches the characters *or* if anything in the balloon help provided for the preferences matches the search text.
To find out more about any particular Preference, hold the mouse over it for a moment and balloon help will appear. Also, a complete list of all the Preferences, with documentation for each, is included below.
Preferences whose names are in shown in bold in the Preferences Panel are designated as being allowed to vary from project to project; those whose name are not in bold are "global", which is to say, they apply equally whatever project you are in.
Click on the name of any preference to get a menu which allows you to *change* whether the preference should vary from project to project or should be global, and also allows you to browse all the senders of the preference, and to discover all the categories under which the preference has been classified, and to be handed a button that you can drop wherever you please that will control the preference.
If you like all your current Preferences settings, you may wish to hit the "Save Current Settings as my Personal Preferences" button. Once you have done that, you can at any point in the future hit "Restore my Personal Preferences" and all your saved settings will get restored immediately.
Also, you can use "themes" to set multiple preferences all at once; click on the "change theme..." button in the Squeak flap or in the Preferences panel, or seek out the themes item in the Appearance menu.' translated.
aStream cr; cr; nextPutAll: '-----------------------------------------------------------------';
cr; cr; nextPutAll: 'Alphabetical listing of all Preferences' translated; cr; cr.
+ (Preferences allPreferences sort: [:a :b | a name < b name]) do:
- (Preferences allPreferences asSortedCollection: [:a :b | a name < b name]) do:
[:pref | | aHelpString |
aStream nextPutAll: pref name; cr.
aHelpString := pref helpString translated.
(aHelpString beginsWith: pref name) ifTrue:
[aHelpString := aHelpString copyFrom: (pref name size ) to: aHelpString size].
aHelpString := (aHelpString copyReplaceAll: String cr with: ' ') copyWithout: Character tab.
aStream nextPutAll: aHelpString capitalized.
(aHelpString isEmpty or: [aHelpString last == $.]) ifFalse: [aStream nextPut: $.].
aStream cr; cr]].
UIManager default edit: aString label: 'About Preferences' translated
"Preferences giveHelpWithPreferences"!
Item was changed:
----- Method: Project class>>allNames (in category 'utilities') -----
allNames
+
+ ^(self allProjects collect: [:p | p name]) sort: [:n1 :n2 | n1 caseInsensitiveLessOrEqual: n2]!
- ^ (self allProjects collect: [:p | p name]) asSortedCollection: [:n1 :n2 | n1 asLowercase < n2 asLowercase]!
Item was changed:
----- Method: Project class>>allNamesAndProjects (in category 'utilities') -----
allNamesAndProjects
+
+ ^(self allProjects
+ sorted: [ :p1 :p2 | p1 name caseInsensitiveLessOrEqual: p2 name ])
+ replace: [ :aProject | Array with: aProject name with: aProject ]!
- ^ (self allProjects asSortedCollection: [:p1 :p2 | p1 name asLowercase < p2 name asLowercase]) collect:
- [:aProject | Array with: aProject name with: aProject]!
Item was changed:
----- Method: Project class>>sweep: (in category 'squeaklet on server') -----
sweep: aServerDirectory
| repository list parts ind entry projectName versions |
"On the server, move all but the three most recent versions of each Squeaklet to a folder called 'older'"
"Project sweep: ((ServerDirectory serverNamed: 'DaniOnJumbo') clone
directory: '/vol0/people/dani/Squeaklets/2.7')"
"Ensure the 'older' directory"
(aServerDirectory includesKey: 'older')
ifFalse: [aServerDirectory createDirectory: 'older'].
repository := aServerDirectory clone directory: aServerDirectory directory, '/older'.
"Collect each name, and decide on versions"
list := aServerDirectory fileNames.
list isString ifTrue: [^ self inform: 'server is unavailable' translated].
+ list sort.
- list := list asSortedCollection asOrderedCollection.
parts := list collect: [:en | Project parseProjectFileName: en].
parts := parts select: [:en | en third = 'pr'].
ind := 1.
[entry := list at: ind.
projectName := entry first asLowercase.
versions := OrderedCollection new. versions add: entry.
[(ind := ind + 1) > list size
ifFalse: [(parts at: ind) first asLowercase = projectName
ifTrue: [versions add: (parts at: ind). true]
ifFalse: [false]]
ifTrue: [false]] whileTrue.
aServerDirectory moveYoungest: 3 in: versions to: repository.
ind > list size] whileFalse.
!
Item was added:
+ ----- Method: PseudoClass>>classInstVarNames (in category 'accessing') -----
+ classInstVarNames
+
+ self realClass ifNotNil: [ :realClass | ^realClass instVarNames ].
+ ^#()!
Item was added:
+ ----- Method: PseudoClass>>classVarNames (in category 'accessing') -----
+ classVarNames
+
+ self realClass ifNotNil: [ :realClass | ^realClass classVarNames ].
+ ^#()!
Item was changed:
----- Method: SmalltalkImage>>presumedSentMessages (in category 'shrinking') -----
presumedSentMessages | sent |
"Smalltalk presumedSentMessages"
"The following should be preserved for doIts, etc"
sent := IdentitySet new.
#(compactSymbolTable rebuildAllProjects
browseAllSelect: lastRemoval
scrollBarValue: vScrollBarValue: scrollBarMenuButtonPressed:
withSelectionFrom: to: removeClassNamed:
dragon: hilberts: mandala: web test3 factorial tinyBenchmarks benchFib
newDepth: restoreAfter: zapAllMethods obsoleteClasses
removeAllUnSentMessages abandonSources removeUnreferencedKeys
reclaimDependents zapOrganization condenseChanges browseObsoleteReferences
subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:
methodsFor:stamp: methodsFor:stamp:prior: instanceVariableNames:
+ unusedClasses) do:
- startTimerInterruptWatcher unusedClasses) do:
[:sel | sent add: sel].
"The following may be sent by perform: in dispatchOnChar..."
Smalltalk at: #ParagraphEditor ifPresent: [:paragraphEditor |
(paragraphEditor classPool at: #CmdActions) asSet do:
[:sel | sent add: sel].
(paragraphEditor classPool at: #ShiftCmdActions) asSet do:
[:sel | sent add: sel]].
^ sent!
Item was changed:
----- Method: SmalltalkImage>>removeAllUnSentMessages (in category 'shrinking') -----
removeAllUnSentMessages
"Smalltalk removeAllUnSentMessages"
"[Smalltalk unusedClasses do: [:c | (Smalltalk at: c) removeFromSystem].
Smalltalk removeAllUnSentMessages > 0] whileTrue."
"Remove all implementations of unsent messages."
| sels n |
sels := self systemNavigation allUnSentMessages.
"The following should be preserved for doIts, etc"
"needed even after #majorShrink is pulled"
+ #(#compactSymbolTable #rebuildAllProjects #browseAllSelect: #lastRemoval #scrollBarValue: vScrollBarValue: #scrollBarMenuButtonPressed: #withSelectionFrom: #to: #removeClassNamed: #dragon: #hilberts: #mandala: #web #test3 #factorial #tinyBenchmarks #benchFib #newDepth: #restoreAfter: #zapAllMethods #obsoleteClasses #removeAllUnSentMessages #abandonSources #removeUnreferencedKeys #reclaimDependents #zapOrganization #condenseChanges #browseObsoleteReferences #subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: #methodsFor:stamp: #methodsFor:stamp:prior: #instanceVariableNames: #unusedClasses )
- #(#compactSymbolTable #rebuildAllProjects #browseAllSelect: #lastRemoval #scrollBarValue: vScrollBarValue: #scrollBarMenuButtonPressed: #withSelectionFrom: #to: #removeClassNamed: #dragon: #hilberts: #mandala: #web #test3 #factorial #tinyBenchmarks #benchFib #newDepth: #restoreAfter: #zapAllMethods #obsoleteClasses #removeAllUnSentMessages #abandonSources #removeUnreferencedKeys #reclaimDependents #zapOrganization #condenseChanges #browseObsoleteReferences #subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: #methodsFor:stamp: #methodsFor:stamp:prior: #instanceVariableNames: #startTimerInterruptWatcher #unusedClasses )
do: [:sel | sels
remove: sel
ifAbsent: []].
"The following may be sent by perform: in dispatchOnChar..."
(Smalltalk at: #ParagraphEditor) ifNotNilDo: [:paragraphEditor |
(paragraphEditor classPool at: #CmdActions) asSet
do: [:sel | sels
remove: sel
ifAbsent: []].
(paragraphEditor classPool at: #ShiftCmdActions) asSet
do: [:sel | sels
remove: sel
ifAbsent: []]].
sels size = 0
ifTrue: [^ 0].
n := 0.
self systemNavigation
allBehaviorsDo: [:x | n := n + 1].
'Removing ' , sels size printString , ' messages . . .'
displayProgressFrom: 0
to: n
during: [:bar |
n := 0.
self systemNavigation
allBehaviorsDo: [:class |
bar value: (n := n + 1).
sels
do: [:sel | class basicRemoveSelector: sel]]].
^ sels size!
Item was changed:
----- Method: SpaceTally>>compareTallyIn:to: (in category 'fileOut') -----
compareTallyIn: beforeFileName to: afterFileName
"SpaceTally new compareTallyIn: 'tally' to: 'tally2'"
| answer s beforeDict a afterDict allKeys |
beforeDict := Dictionary new.
s := FileDirectory default fileNamed: beforeFileName.
[s atEnd] whileFalse: [
a := Array readFrom: s nextLine.
beforeDict at: a first put: a allButFirst.
].
s close.
afterDict := Dictionary new.
s := FileDirectory default fileNamed: afterFileName.
[s atEnd] whileFalse: [
a := Array readFrom: s nextLine.
afterDict at: a first put: a allButFirst.
].
s close.
answer := WriteStream on: String new.
+ allKeys := (Set new addAll: beforeDict keys; addAll: afterDict keys; yourself) sorted.
- allKeys := (Set new addAll: beforeDict keys; addAll: afterDict keys; yourself) asSortedCollection.
allKeys do: [ :each |
| before after diff |
before := beforeDict at: each ifAbsent: [#(0 0 0)].
after := afterDict at: each ifAbsent: [#(0 0 0)].
diff := before with: after collect: [ :vBefore :vAfter | vAfter - vBefore].
diff = #(0 0 0) ifFalse: [
answer nextPutAll: each,' ',diff printString; cr.
].
].
StringHolder new contents: answer contents; openLabel: 'space diffs'.
!
Item was changed:
----- Method: SystemNavigation>>allMethodsInCategory: (in category 'browse') -----
allMethodsInCategory: category
| aCollection |
+ aCollection := OrderedCollection new.
- aCollection := SortedCollection new.
Cursor wait showWhile:
[self allBehaviorsDo:
[:x | (x allMethodsInCategory: category) do:
[:sel | aCollection add: x name , ' ' , sel]]].
+ ^aCollection sort.
- ^aCollection.
!
Item was changed:
----- Method: SystemNavigation>>allSelectorsWithAnyImplementorsIn: (in category 'query') -----
allSelectorsWithAnyImplementorsIn: selectorList
"Answer the subset of the given list which represent method selectors
which have at least one implementor in the system."
| good |
+ good := Set new.
- good := OrderedCollection new.
self allBehaviorsDo: [:class | selectorList
do: [:aSelector | (class includesSelector: aSelector)
ifTrue: [good add: aSelector]]].
+ ^good sorted
+
+ "
- ^ good asSet asSortedArray"
SystemNavigation new selectorsWithAnyImplementorsIn: #( contents
contents: nuts)
"!
Item was changed:
----- Method: SystemNavigation>>browseAllImplementorsOf:localToPackage: (in category 'browse') -----
browseAllImplementorsOf: selector localToPackage: packageNameOrInfo
"Create and schedule a message browser on each method in the given package
that implements the message whose selector is the argument, selector. For example,
SystemNavigation new browseAllImplementorsOf: #at:put: localToPackage: 'Collections'."
self browseMessageList: (self
allImplementorsOf: selector
+ localToPackage: packageNameOrInfo)
- localToPackage: packageNameOrInfo) asSortedCollection
name: 'Implementors of ' , selector,
' local to package ', (self packageInfoFor: packageNameOrInfo) name!
Item was changed:
----- Method: SystemNavigation>>browseAllSelect:localTo: (in category 'browse') -----
browseAllSelect: aBlock localTo: aClass
"Create and schedule a message browser on each method in or below the given class
that, when used as the block argument to aBlock gives a true result. For example,
SystemNavigation default browseAllSelect: [:m | m numLiterals > 10] localTo: Morph."
aClass ifNil: [^self inform: 'no class selected'].
^self
+ browseMessageList: (self allMethodsSelect: aBlock localTo: aClass) sorted
- browseMessageList: (self allMethodsSelect: aBlock localTo: aClass) asSortedCollection
name: 'selected messages local to ', aClass name!
Item was changed:
----- Method: SystemNavigation>>browseClassCommentsWithString: (in category 'browse') -----
browseClassCommentsWithString: aString
"Smalltalk browseClassCommentsWithString: 'my instances' "
"Launch a message list browser on all class comments containing aString as a substring."
| caseSensitive suffix list |
suffix := (caseSensitive := Sensor shiftPressed)
ifTrue: [' (case-sensitive)']
ifFalse: [' (use shift for case-sensitive)'].
list := Set new.
Cursor wait showWhile: [
Smalltalk allClassesDo: [:class |
(class organization classComment asString findString: aString
startingAt: 1 caseSensitive: caseSensitive) > 0 ifTrue: [
list add: (
MethodReference
class: class
selector: #Comment
)
]
]
].
^ self
+ browseMessageList: list sorted
- browseMessageList: list asSortedCollection
name: 'Class comments containing ' , aString printString , suffix
autoSelect: aString!
Item was changed:
----- Method: SystemNavigation>>browseClassesWithNamesContaining:caseSensitive: (in category 'browse') -----
browseClassesWithNamesContaining: aString caseSensitive: caseSensitive
"Smalltalk browseClassesWithNamesContaining: 'eMorph' caseSensitive: true "
"Launch a class-list list browser on all classes whose names containg aString as a substring."
| suffix aList |
suffix := caseSensitive
ifTrue: [' (case-sensitive)']
ifFalse: [' (use shift for case-sensitive)'].
aList := OrderedCollection new.
Cursor wait
showWhile: [Smalltalk
allClassesDo: [:class | (class name includesSubstring: aString caseSensitive: caseSensitive)
ifTrue: [aList add: class name]]].
aList size > 0
+ ifTrue: [ToolSet openClassListBrowser: aList asSet sorted title: 'Classes whose names contain ' , aString , suffix]!
- ifTrue: [ToolSet openClassListBrowser: aList asSet asSortedArray title: 'Classes whose names contain ' , aString , suffix]!
Item was changed:
----- Method: SystemNavigation>>showMenuOf:withFirstItem:ifChosenDo:withCaption: (in category 'ui') -----
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
"Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters. Use aCaption as the menu title, if it is not nil. Evaluate choiceBlock if a message is chosen."
| index menuLabels sortedList |
+ sortedList := selectorCollection sorted.
- sortedList := selectorCollection asSortedCollection.
menuLabels := Array streamContents:
[:strm | strm nextPut: (firstItem contractTo: 40).
sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
index := UIManager default chooseFrom: menuLabels lines: #(1).
index = 1 ifTrue: [choiceBlock value: firstItem].
index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]!
Item was changed:
----- Method: SystemVersion>>highestUpdate (in category 'accessing') -----
highestUpdate
+
+ ^highestUpdate ifNil: [
+ highestUpdate := self updates isEmpty
+ ifTrue: [ 0 ]
+ ifFalse: [ self updates max ] ]!
- | sortedUpdates |
- highestUpdate ifNil: [
- sortedUpdates := self updates asSortedCollection.
- highestUpdate := (sortedUpdates isEmpty
- ifTrue: [0]
- ifFalse: [sortedUpdates last])].
- ^highestUpdate!
Item was changed:
----- Method: TranslatedReceiverFinder class>>browseNonLiteralReceivers (in category 'utilities') -----
browseNonLiteralReceivers
"TranslatedReceiverFinder browseNonLiteralReceivers"
SystemNavigation default
+ browseMessageList: self new nonLiteralReceivers
- browseMessageList: self new nonLiteralReceivers asSortedCollection
name: 'Non literal receivers of #translated'
autoSelect: 'translated'!
Levente Uzonyi uploaded a new version of Sound to project The Trunk:
http://source.squeak.org/trunk/Sound-ul.60.mcz
==================== Summary ====================
Name: Sound-ul.60
Author: ul
Time: 13 March 2017, 2:58:01.850611 pm
UUID: 3729fde3-4fa7-4961-85f1-06f8d4f21324
Ancestors: Sound-tfel.59
SortedCollection Whack-a-mole
=============== Diff against Sound-tfel.59 ===============
Item was changed:
----- Method: SampledInstrument>>readSampleSetFrom: (in category 'other') -----
readSampleSetFrom: dirName
"Answer a collection of sounds read from AIFF files in the given directory and sorted in ascending pitch order."
| all dir |
+ all := OrderedCollection new.
- all := SortedCollection sortBlock: [:s1 :s2 | s1 pitch < s2 pitch].
dir := FileDirectory default on: dirName.
dir fileNames do: [:n | | fullName snd |
fullName := dir fullNameFor: n.
UIManager default
informUser: 'Reading AIFF file ', n
during:
[snd := LoopedSampledSound new
fromAIFFFileNamed: fullName
mergeIfStereo: true].
all add: snd].
+ ^ all asArray sort: [:s1 :s2 | s1 pitch < s2 pitch]
- ^ all asArray
!
Levente Uzonyi uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-ul.58.mcz
==================== Summary ====================
Name: ShoutCore-ul.58
Author: ul
Time: 13 March 2017, 2:56:26.63928 pm
UUID: 8bcf6f78-fd6f-4e44-a67c-56260f0bb0e8
Ancestors: ShoutCore-mt.57
SortedCollection Whack-a-mole
=============== Diff against ShoutCore-mt.57 ===============
Item was changed:
----- Method: SHTextStylerST80>>replaceStringForRangesWithType:with:in: (in category 'private') -----
replaceStringForRangesWithType: aSymbol with: aString in: aText
"Answer aText if no replacements, or a copy of aText with
each range with a type of aSymbol replaced by aString"
| answer toReplace adjustSourceMap increaseInLength |
+ toReplace := self rangesIn: aText setWorkspace: false.
+ toReplace removeAllSuchThat: [ :each | each type ~~ aSymbol ].
- toReplace := (self rangesIn: aText setWorkspace: false)
- select: [:each | each type = aSymbol].
toReplace isEmpty ifTrue: [^aText].
answer := aText copy.
increaseInLength := 0.
adjustSourceMap := sourceMap notNil and:[sourceMap ~~ processedSourceMap].
+ toReplace
+ sort: [:a :b | a start <= b start];
- (toReplace asSortedCollection: [:a :b | a start <= b start])
do: [:each | | end start thisIncrease |
start := each start + increaseInLength.
end := each end + increaseInLength.
answer replaceFrom: start to: end with: aString.
thisIncrease := aString size - each length.
increaseInLength := increaseInLength + thisIncrease.
adjustSourceMap ifTrue:[
sourceMap do:[:assoc | | first newFirst last newLast |
first := newFirst := assoc value first.
last := newLast := assoc value last.
first > start ifTrue:[newFirst := first + thisIncrease].
last > start ifTrue:[newLast := last + thisIncrease].
(first ~= newFirst or:[last ~= newLast])
ifTrue:[assoc value: (newFirst to: newLast)]]]].
adjustSourceMap ifTrue:[processedSourceMap := sourceMap].
^answer!
Levente Uzonyi uploaded a new version of Services-Base to project The Trunk:
http://source.squeak.org/trunk/Services-Base-ul.61.mcz
==================== Summary ====================
Name: Services-Base-ul.61
Author: ul
Time: 13 March 2017, 2:55:49.489542 pm
UUID: ae52e622-4ca1-4852-bdbb-2a20bd5200c0
Ancestors: Services-Base-mt.60
SortedCollection Whack-a-mole
=============== Diff against Services-Base-mt.60 ===============
Item was changed:
----- Method: ServicePreferences class>>replayPreferences: (in category 'replaying') -----
replayPreferences: preferences
+
+ (preferences sorted: [ :a :b | a last < b last ])
- | s |
- s := SortedCollection new
- sortBlock: [:a :b | a last < b last].
- s addAll: preferences;
- reSort.
- s
do: [:e | | v |
v := self valueOfPreference: e first ifAbsent: ''.
self setPreference: e first toValue: (v
ifEmpty: ['']
ifNotEmpty: [v , ' '])
, e second]!