[squeak-dev] The Trunk: Collections-mt.845.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jul 22 08:01:09 UTC 2019


Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.845.mcz

==================== Summary ====================

Name: Collections-mt.845
Author: mt
Time: 22 July 2019, 10:01:05.9849 am
UUID: f3187206-088a-4183-ae97-52fdb06b88cf
Ancestors: Collections-dtl.844

During all-literals enumeration, do not decend into association values.

Users want to find the tokens they typed, not what the system generated or somehow stored. In particular, there is no need to look into class variables for literals. :-)

=============== Diff against Collections-dtl.844 ===============

Item was removed:
- ----- Method: Association>>allLiteralsDo: (in category 'literals') -----
- allLiteralsDo: aBlock
- 	"This strategy origins from a former implementation of CompiledMethod >> #hasLiteralThorough: as well as AdditionalMethodState >> #hasLiteralSuchThat:."
- 
- 	"I am a literal."
- 	aBlock value: self.
- 	
- 	"All my components are literals."
- 	self key allLiteralsDo: aBlock.
- 	self value allLiteralsDo: aBlock.!

Item was removed:
- ----- Method: Association>>literalEqual: (in category 'literals') -----
- literalEqual: otherLiteral
- 	"Answer true if the receiver and otherLiteral represent the same literal.
- 	Variable bindings are literally equals only if identical.
- 	This is how variable sharing works, by preserving identity and changing only the value."
- 	^self == otherLiteral!

Item was added:
+ ----- Method: LookupKey>>allLiteralsDo: (in category 'literals') -----
+ allLiteralsDo: aBlock
+ 	"Treat myself or my key as literal. Do not treat any value (i.e., in Association or Binding) as literal to avoid decending too thoroughly. As a consequence, for example, classes have to be resolved to their class bindings or class names before using them as input in this interface."
+ 	
+ 	aBlock value: self.	
+ 	self key allLiteralsDo: aBlock.!

Item was added:
+ ----- Method: LookupKey>>literalEqual: (in category 'literals') -----
+ literalEqual: otherLiteral
+ 	"Answer true if the receiver and otherLiteral represent the same literal. 
+ 	
+ 	By default, all lookup keys (such as variable bindings) are literally equal only if identical. This is how variable sharing works, by preserving identity and changing only the value.
+ 	
+ 	Override if you want to be more flexible such as in class bindings."
+ 	
+ 	^ self == otherLiteral!



More information about the Squeak-dev mailing list