David T. Lewis uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ms.254.mcz
==================== Summary ====================
Name: MorphicExtras-ms.254
Author: ms
Time: 22 March 2019, 1:48:31.043664 pm
UUID: d7b3adea-c5be-47f1-8247-7c5ae1ad7f34
Ancestors: MorphicExtras-kfr.253
Adds a preview morph for results of all BitBlt rules.
When first using BitBlt, it wasn't easy to understand the effects of the possible rules on pixel combinating for me.
I implemented two example methods which preview the effects of rule 0 to 41 (these are all, I believe) on quadratic existing forms with colors and 1 bit alpha channel (previewAllBitBltRules uses ToolIcons flag/collection) plus Forms with more alpha values (previewAllBitBltRulesWithAlpha uses ToolIcons flag and a Color red + 0.4 alpha preview). They generate a combined morph for all rules applied on these forms (scaled, because icons are small) and opens it in your hand.
Internally, this morph can be generated for any rule, forms and scale. Rules which throw exceptions are replaced with a fallback form.
Now in the correct package (see http://forum.world.st/The-Inbox-Graphics-ms-407-mcz-td5097206.html ).
Thank you for your feedback!
=============== Diff against MorphicExtras-kfr.253 ===============
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRules (in category '*MorphicExtras') -----
+ previewAllBitBltRules
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ToolIcons collection
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewAllBitBltRulesWithAlpha (in category '*MorphicExtras') -----
+ previewAllBitBltRulesWithAlpha
+
+ (self previewBitBltRules: (0 to: 41)
+ on: ToolIcons flag
+ and: ((Color red alpha: 0.4) iconOrThumbnailOfSize: 12)
+ fallback: ToolIcons exception
+ scaledTo: 32) openInHand.!
Item was added:
+ ----- Method: BitBlt class>>previewBitBltRules:on:and:fallback:scaledTo: (in category '*MorphicExtras') -----
+ previewBitBltRules: rules on: aForm1 and: aForm2 fallback: fallbackForm scaledTo: aNumberOrPoint
+ "Returns a combined morph of the result of each rule applied on aForm1 combined with
+ aForm2 scaled to aNumberOrPoint. If the combination faild with a rule, fallbackForm is
+ shown instead. The number of each rule is appended at the bottom of each result."
+
+ | resultMorph tileExtent |
+ tileExtent := aNumberOrPoint asPoint.
+ resultMorph := Morph new
+ color: Color transparent;
+ extent: (rules size * tileExtent x)@tileExtent y;
+ yourself.
+
+ rules withIndexDo: [ :rule :index | | form formMorph numberLabel |
+ form := aForm1 copy.
+ [aForm2 copy displayOn: form at: 0@0 rule: rule]
+ on: Exception
+ do: [form := fallbackForm].
+ formMorph := (form scaledToSize: tileExtent) asMorph
+ position: (index*tileExtent x)@0;
+ yourself.
+ resultMorph addMorph: formMorph.
+
+ numberLabel := rule asString asMorph
+ center: ((index+0.5)*tileExtent x)@tileExtent y;
+ yourself.
+ resultMorph addMorph: numberLabel].
+
+ ^ resultMorph!
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.823.mcz
==================== Summary ====================
Name: Collections-ul.823
Author: ul
Time: 22 March 2019, 12:04:40.596433 pm
UUID: 2fef1e34-e45a-4f70-bb7b-56aa1c610df9
Ancestors: Collections-pre.822
Fixed bug in Heap >> #upHeap:. When the first element of a Heap was removed, the index of the first object was not always updated.
=============== Diff against Collections-pre.822 ===============
Item was changed:
----- Method: Heap>>upHeap: (in category 'private-heap') -----
upHeap: anIndex
"Check the heap upwards for correctness starting at anIndex.
Everything below anIndex is ok."
| index parentValue parentIndex value |
+ anIndex = 1 ifTrue: [
+ indexUpdateBlock ifNotNil: [ indexUpdateBlock value: (array at: 1) value: 1 ].
+ ^self ].
- anIndex = 1 ifTrue: [ ^self ].
value := array at: (index := anIndex).
[ index > 1 and: [
parentValue := array at: (parentIndex := index bitShift: -1).
sortBlock
ifNil: [ value <= parentValue ]
ifNotNil: [ sortBlock value: value value: parentValue ] ] ]
whileTrue: [
array at: index put: parentValue.
indexUpdateBlock ifNotNil: [ indexUpdateBlock value: parentValue value: index ].
index := parentIndex ].
array at: index put: value.
indexUpdateBlock ifNotNil: [ indexUpdateBlock value: value value: index ]!
Patrick Rein uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-pre.822.mcz
==================== Summary ====================
Name: Collections-pre.822
Author: pre
Time: 20 March 2019, 8:05:20.383677 pm
UUID: 483c4461-cee4-4a4f-82d3-fbc03e7201cc
Ancestors: Collections-dtl.821
Adds #isMutator to Symbol which is analogous to asMutator.
=============== Diff against Collections-dtl.821 ===============
Item was added:
+ ----- Method: Symbol>>isMutator (in category 'testing') -----
+ isMutator
+
+ ^ self isKeyword and: [self numArgs = 1]!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.403.mcz
==================== Summary ====================
Name: Compiler-eem.403
Author: eem
Time: 19 March 2019, 11:58:47.238202 am
UUID: a0f07dce-0a58-422e-af37-32d5a3bd6546
Ancestors: Compiler-eem.402
Fixed yhree typos in a comment, and improved the class comments for ParseNodeEnumerator & subclass.
=============== Diff against Compiler-eem.402 ===============
Item was changed:
ParseNodeVisitor subclass: #ParseNodeEnumerator
instanceVariableNames: 'theBlock theSelectBlock'
classVariableNames: ''
poolDictionaries: ''
category: 'Compiler-Support'!
+ !ParseNodeEnumerator commentStamp: 'eem 3/19/2019 11:58' prior: 0!
- !ParseNodeEnumerator commentStamp: 'eem 8/31/2010 11:41' prior: 0!
ParseNodeEnumerator implements ParseNode>>nodesDo:. It can be used to enumerate an entire tree via
aParseNode accept: (ParseNodeEnumerator ofBlock: aBlock)
or selectively, excluding the node and subnodes for which selectBlock answers false, via
aParseNode accept: (ParseNodeEnumerator
ofBlock: aBlock
select: selectBlock)
+ Instance Variables
+ theBlock: <BlockClosure>
+ theSelectBlock: <BlockClosure | nil>
+ theBlock
+ - the block that is evaluated with the parse nodes the receiver visits.
+
+ theSelectBlock
+ - an optional block used to select blocks to visit and descend into.
+
Here's a doIt that generates and compiles the visiting methods:
self superclass selectors do:
[:s|
self compile: (String streamContents:
[:str| | arg |
arg := 'a', (s allButFirst: 5) allButLast.
str nextPutAll: s, ' ', arg; crtab;
nextPutAll: '(theSelectBlock isNil or: [theSelectBlock value: '; nextPutAll: arg; nextPutAll: ']) ifFalse:'; crtab;
tab: 2; nextPutAll: '[^nil].'; crtab;
nextPutAll: 'theBlock value: '; nextPutAll: arg; nextPut: $.; crtab;
nextPutAll: '^super '; nextPutAll: s, ' ', arg])]!
Item was changed:
ParseNodeEnumerator subclass: #ParseNodeWithPrecedingStatementEnumerator
instanceVariableNames: 'precedingStatement'
classVariableNames: ''
poolDictionaries: ''
category: 'Compiler-Support'!
+
+ !ParseNodeWithPrecedingStatementEnumerator commentStamp: 'eem 3/19/2019 11:55' prior: 0!
+ A ParseNodeWithPrecedingStatementEnumerator is a ParseNodeEnumerator that accepts a binary block in ofBlock:, and hence enumerates statement nodes with their preceding statement, or nil if they are the first.
+
+ Instance Variables
+ precedingStatement: <ParseNode | nil>
+
+ precedingStatement
+ - the preceding statement node, if any
+ !
Item was changed:
----- Method: ParseNodeWithPrecedingStatementEnumerator>>ofBlock: (in category 'initialize-release') -----
ofBlock: aBlock
"N.B. This enumerator visits a node before any of the node's children.
+ Hence, when enumerating statements in a block, we can ensure that
+ the second argument to the block, the preceding statement, is non-nil
+ only for top-level statements in the block by nilling out precedingStatement
- Hence, when enumewrating statements in a block, we can ensure that
- the second argument to the block, the preceeding statement, is non-nil
- only for top-level statements in the block by nilling out preceedingStatement
once the block is evaluated. Perhaps stronger would be to capture its value
in a temporary and nil it before evaluating, but this is good enough."
theBlock := [:node|
aBlock value: node value: precedingStatement.
precedingStatement := nil]!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ul.401.mcz
==================== Summary ====================
Name: Compiler-ul.401
Author: ul
Time: 16 March 2019, 11:56:29.899053 pm
UUID: 395adc27-f48e-484c-9097-5197ea3a0155
Ancestors: Compiler-eem.400
- fixed typo
=============== Diff against Compiler-eem.400 ===============
Item was changed:
----- Method: ParseNodeWithPrecedingStatementEnumerator>>ofBlock: (in category 'initialize-release') -----
ofBlock: aBlock
"N.B. This enumerator visits a node before any of the node's children.
Hence, when enumewrating statements in a block, we can ensure that
the second argument to the block, the preceeding statement, is non-nil
only for top-level statements in the block by nilling out preceedingStatement
once the block is evaluated. Perhaps stronger would be to capture its value
in a temporary and nil it before evaluating, but this is good enough."
theBlock := [:node|
aBlock value: node value: precedingStatement.
+ precedingStatement := nil]!
- preceedingStatement := nil]!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.402.mcz
==================== Summary ====================
Name: Compiler-eem.402
Author: eem
Time: 19 March 2019, 11:44:20.570473 am
UUID: 886de89c-a3ed-4fb5-a8ed-7f9bf78d69b6
Ancestors: Compiler-eem.401, Compiler-ul.401
Merge with Compiler-ul.401, eliminate undeclatred variable in ParseNodeWithPrecedingStatementEnumerator.
=============== Diff against Compiler-eem.401 ===============
Item was changed:
----- Method: ParseNodeWithPrecedingStatementEnumerator>>ofBlock: (in category 'initialize-release') -----
ofBlock: aBlock
"N.B. This enumerator visits a node before any of the node's children.
Hence, when enumewrating statements in a block, we can ensure that
the second argument to the block, the preceeding statement, is non-nil
only for top-level statements in the block by nilling out preceedingStatement
once the block is evaluated. Perhaps stronger would be to capture its value
in a temporary and nil it before evaluating, but this is good enough."
theBlock := [:node|
aBlock value: node value: precedingStatement.
+ precedingStatement := nil]!
- preceedingStatement := nil]!