Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1123.mcz
==================== Summary ====================
Name: System-mt.1123
Author: mt
Time: 19 November 2019, 12:05:29.547265 pm
UUID: 084b44a2-c237-c445-b14c-c84158296a4c
Ancestors: System-mt.1121, System-ct.1094, System-ct.1095, System-ct.1096, System-ct.1104, System-ct.1105, System-ct.1106, System-ct.1112
Merge, merge, merge. Fixes in Project, minor category clean-up in SmalltalkImage, better class comment in MethodReference, new utility method in ChangeSet.
=============== Diff against System-mt.1121 ===============
Item was added:
+ ----- Method: ChangeSet class>>removeEmptyChangeSets (in category 'enumerating') -----
+ removeEmptyChangeSets
+ "Remove all change sets that are empty
+ and which are not nailed down by belonging to a Project."
+ "ChangeSet removeEmptyChangeSets"
+ | toGo |
+ toGo := self allChangeSets
+ select: [:cs | cs isEmpty and: [cs okayToRemoveInforming: false]]
+ thenDo: [:cs | self removeChangeSet: cs].
+ self inform: toGo size printString, ' change set(s) removed.'!
Item was changed:
Object subclass: #MethodReference
instanceVariableNames: 'classSymbol classIsMeta methodSymbol stringVersion category environment'
classVariableNames: 'InvalidReference'
poolDictionaries: ''
category: 'System-Tools'!
+ !MethodReference commentStamp: 'ct 9/21/2019 17:22' prior: 0!
+ A MethodReference is is a lightweight proxy for a CompiledMethod. Has methods to refer to the CompileMethod's source statements, byte codes. Is heavily used by Tools.
- !MethodReference commentStamp: 'tlk 5/9/2006 18:43' prior: 0!
- A MethodReference is is a lightweight proxy for a CompiledMethod. Has methods for pointed to the CompileMethod's source statements, byte codes. Is heavily used my Tools.
Instance Variables
+ classIsMeta: Boolean class vs. instance
- classIsMeta: Boolean class vs. instance
classSymbol: Symbol for method's class (without class keyword if meta)
+ methodSymbol: Symbol for method's selector
- methodSymbol: Symbol for method's selector
stringVersion: 'Class>>selector:' format
!
Item was changed:
----- Method: Project>>okToChange (in category 'release') -----
okToChange
"Answer whether the window in which the project is housed can be dismissed -- which is destructive. We never clobber a project without confirmation"
| answer |
(self isCurrentProject and: [self isTopProject]) ifTrue: [
self inform: 'You cannot close the top project.'.
^ false].
(self confirm: ('Do you really want to delete the project\{1}\and all its content?' withCRs translated format:{self name}))
ifFalse: [^ false].
self subProjects ifNotEmpty: [:sp |
answer := Project uiManager
chooseFrom: #(
"1" 'Lift all sub-projects'
"2" 'Discard all sub-projects (NO UNDO!!)'
"3 or 0" 'Cancel')
lines: #(2)
title: ('The project {1}\contains {2} sub-project(s).' withCRs translated format:{self name. sp size}).
(answer = 0 or: [answer = 3]) ifTrue: [^ false].
answer = 1 ifTrue: [self liftSubProjects. ^ true].
+ answer = 2 ifTrue: [^ sp allSatisfy: [:ea |
+ [ea okToChange] valueSuppressingMessages: {'*delete the project*and all its content*'}]]].
- answer = 2 ifTrue: [^ sp allSatisfy: [:ea | ea okToChange]]].
^ true!
Item was changed:
----- Method: Project>>previewImageForm (in category 'displaying') -----
previewImageForm
+ ^ self imageForm scaledToSize: self viewSize!
- ^ self imageForm!
Item was removed:
- ----- Method: Project>>setViewSize: (in category 'accessing') -----
- setViewSize: aPoint
- viewSize := aPoint!
Item was added:
+ ----- Method: Project>>transcript (in category 'accessing') -----
+ transcript
+
+ ^ transcript!
Item was added:
+ ----- Method: Project>>viewSize: (in category 'accessing') -----
+ viewSize: aPoint
+ viewSize := aPoint!
Item was changed:
+ ----- Method: SmalltalkImage>>add:toList:after: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>add:toList:after: (in category 'startup list') -----
add: aClass toList: startUpOrShutDownList after: predecessor
"Add the name of aClass to the startUp or shutDown list.
Add it after the name of predecessor"
(Smalltalk globals includes: aClass)
ifFalse: [self error: aClass name , ' cannot be found in Smalltalk dictionary.'].
"Add after predecessor, moving it if already there."
(Smalltalk globals includes: predecessor)
ifFalse: [self error: predecessor name , ' cannot be found in Smalltalk dictionary.'].
(startUpOrShutDownList includes: predecessor name)
ifFalse: [self error: predecessor name , ' cannot be found in the list.'].
startUpOrShutDownList remove: aClass name ifAbsent:[].
startUpOrShutDownList add: aClass name after: predecessor name!
Item was changed:
+ ----- Method: SmalltalkImage>>add:toList:before: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>add:toList:before: (in category 'startup list') -----
add: aClass toList: startUpOrShutDownList before: successor
"Add the name of aClass to the startUp or shutDown list.
Add it before the name of successor"
(Smalltalk globals includes: aClass)
ifFalse: [self error: aClass name , ' cannot be found in Smalltalk dictionary.'].
"Add before successor, moving it if already there."
(Smalltalk globals includes: successor)
ifFalse: [self error: successor name , ' cannot be found in Smalltalk dictionary.'].
(startUpOrShutDownList includes: successor name)
ifFalse: [self error: successor name , ' cannot be found in the list.'].
startUpOrShutDownList remove: aClass name ifAbsent: [].
startUpOrShutDownList add: aClass name before: successor name.!
Item was changed:
+ ----- Method: SmalltalkImage>>addToShutDownList: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>addToShutDownList: (in category 'startup list') -----
addToShutDownList: aClass
"This will add a ref to this class at the BEGINNING of the shutDown list."
"No-op if already in the list."
(ShutDownList includes: aClass name) ifFalse: [ShutDownList addFirst: aClass name]!
Item was changed:
+ ----- Method: SmalltalkImage>>addToShutDownList:before: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>addToShutDownList:before: (in category 'startup list') -----
addToShutDownList: aClass before: predecessor
self add: aClass toList: ShutDownList before: predecessor!
Item was changed:
+ ----- Method: SmalltalkImage>>addToStartUpList: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>addToStartUpList: (in category 'startup list') -----
addToStartUpList: aClass
"This will add a ref to this class at the END of the startUp list."
"No-op if already in the list."
(StartUpList includes: aClass name) ifFalse: [StartUpList addLast: aClass name]!
Item was changed:
+ ----- Method: SmalltalkImage>>addToStartUpList:before: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>addToStartUpList:before: (in category 'startup list') -----
addToStartUpList: aClass before: predecessor
self add: aClass toList: StartUpList before: predecessor!
Item was added:
+ ----- Method: SmalltalkImage>>at:ifPresent:ifAbsent: (in category 'accessing') -----
+ at: key ifPresent: aBlock ifAbsent: anotherBlock
+ "Lookup the given key in the globals. If it is present, answer the value of evaluating the given block with the value associated with the key. Otherwise, evaluate anotherBlock and answer its result."
+
+ ^globals at: key ifPresent: aBlock ifAbsent: anotherBlock!
Item was changed:
+ ----- Method: SmalltalkImage>>removeFromShutDownList: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>removeFromShutDownList: (in category 'snapshot and quit') -----
removeFromShutDownList: aClass
ShutDownList remove: aClass name ifAbsent: []!
Item was changed:
+ ----- Method: SmalltalkImage>>removeFromStartUpList: (in category 'startup and shutdown list') -----
- ----- Method: SmalltalkImage>>removeFromStartUpList: (in category 'snapshot and quit') -----
removeFromStartUpList: aClass
StartUpList remove: aClass name ifAbsent: []!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.863.mcz
==================== Summary ====================
Name: Collections-mt.863
Author: mt
Time: 19 November 2019, 11:21:39.854265 am
UUID: 217307c8-b585-da43-9494-9a0db5e31144
Ancestors: Collections-mt.862, Collections-ct.861
Merges Collections-ct.861.
=============== Diff against Collections-mt.862 ===============
Item was added:
+ ----- Method: TextIndent class>>scanCharacter (in category 'fileIn/Out') -----
+ scanCharacter
+ "The character used to identify a subclass of TextAttribute for filein and fileout"
+ ^ $I!
Item was added:
+ ----- Method: TextIndent class>>scanFrom: (in category 'fileIn/Out') -----
+ scanFrom: aStream
+
+ ^ self amount: (Integer readFrom: aStream)!
Item was added:
+ ----- Method: TextIndent>>writeScanOn: (in category 'fileIn/fileOut') -----
+ writeScanOn: aStream
+
+ aStream
+ nextPut: self class scanCharacter;
+ store: self amount.!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ct.856.mcz
==================== Summary ====================
Name: Collections-ct.856
Author: ct
Time: 20 September 2019, 6:58:40.039437 pm
UUID: 62cc0002-1fd2-f547-a8d3-7812efadc948
Ancestors: Collections-mt.854
Proposal: Add #detect:ifFound:, which does, obviously, nothing if there is no hit
I found nearly a dozen senders of #detect:ifFound:ifNone: that specify [] as exceptionBlock ...
=============== Diff against Collections-mt.854 ===============
Item was added:
+ ----- Method: Collection>>detect:ifFound: (in category 'enumerating') -----
+ detect: aBlock ifFound: foundBlock
+ "foundBlock takes one argument, the found object."
+ ^ self
+ detect: aBlock
+ ifFound: foundBlock
+ ifNone: []!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.862.mcz
==================== Summary ====================
Name: Collections-mt.862
Author: mt
Time: 19 November 2019, 11:10:22.542265 am
UUID: 892a021e-ac24-bd4f-84ba-12edb793c7a0
Ancestors: Collections-mt.861, Collections-ct.856
Merges Collections-ct.856. Harmonize all #detect: variations including their comments. Complements CollectionsTests-mt.327.
=============== Diff against Collections-mt.861 ===============
Item was changed:
----- Method: Collection>>detect: (in category 'enumerating') -----
detect: aBlock
"Evaluate aBlock with each of the receiver's elements as the argument.
+ Answer the first element for which aBlock evaluates to true. If there is
+ no such element, raise an error."
- Answer the first element for which aBlock evaluates to true."
+ ^ self
+ detect: aBlock
+ ifFound: [:element | element]
+ ifNone: [self errorNotFound: aBlock]!
- ^ self detect: aBlock ifNone: [self errorNotFound: aBlock]!
Item was added:
+ ----- Method: Collection>>detect:ifFound: (in category 'enumerating') -----
+ detect: aBlock ifFound: foundBlock
+ "Evaluate aBlock with each of the receiver's elements as the argument.
+ Answer the first element for which aBlock evaluates to true. If there is
+ no such element, return nil."
+
+ ^ self
+ detect: aBlock
+ ifFound: foundBlock
+ ifNone: nil!
Item was changed:
----- Method: Collection>>detect:ifFound:ifNone: (in category 'enumerating') -----
detect: aBlock ifFound: foundBlock ifNone: exceptionBlock
+ "Evaluate aBlock with each of the receiver's elements as the argument.
+ If there is any element for which aBlock evaluates to true, then evaluate
+ foundBlock with that element and answer the result of that foundBlock.
+ If aBlock does never evaluate to true, evaluate exceptionBlock, which
+ may or may not raise an error."
+
+ self do: [:each | (aBlock value: each) ifTrue: [^ foundBlock value: each]].
+ ^ exceptionBlock value
- "foundBlock takes one argument, the found object."
- self
- do: [ :element | (aBlock value: element) ifTrue: [ ^foundBlock value: element ] ].
- ^exceptionBlock value
!
Item was changed:
----- Method: Collection>>detect:ifNone: (in category 'enumerating') -----
detect: aBlock ifNone: exceptionBlock
"Evaluate aBlock with each of the receiver's elements as the argument.
+ Answer the first element for which aBlock evaluates to true. If there is
+ no such element, evaluate exceptionBlock."
- Answer the first element for which aBlock evaluates to true. If none
- evaluate to true, then evaluate the argument, exceptionBlock."
+ ^ self
+ detect: aBlock
+ ifFound: [:element | element]
+ ifNone: exceptionBlock!
- self do: [:each | (aBlock value: each) ifTrue: [^ each]].
- ^ exceptionBlock value!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ct.855.mcz
==================== Summary ====================
Name: Collections-ct.855
Author: ct
Time: 20 September 2019, 6:56:22.518437 pm
UUID: 079663b5-47e2-bd47-bfa4-86db03bd98d8
Ancestors: Collections-mt.854
Add convenience method for adding many attributes to a Text.
=============== Diff against Collections-mt.854 ===============
Item was added:
+ ----- Method: Text>>addAllAttributes: (in category 'emphasis') -----
+ addAllAttributes: attributes
+
+ attributes do: [:attribute |
+ self addAttribute: attribute].!