Eliot Miranda uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-eem.1528.mcz
==================== Summary ====================
Name: Kernel-eem.1528 Author: eem Time: 2 October 2023, 1:46:30.854649 pm UUID: 2d331a30-1cdc-4e20-9f8e-491cf19b43c2 Ancestors: Kernel-mt.1527
allLiteralsDo: and literalEqual: belong in Kernel, not in Collections. Rename Array & LookupKey's literals category to move it to Kernel.
=============== Diff against Kernel-mt.1527 ===============
Item was added: + ----- Method: Array>>allLiteralsDo: (in category '*Kernel-literals') ----- + allLiteralsDo: aBlock + + "I am a literal." + aBlock value: self. + + "All my elements are literals." + self do: [:each | each allLiteralsDo: aBlock].!
Item was added: + ----- Method: Array>>literalEqual: (in category '*Kernel-literals') ----- + literalEqual: other + + self class == other class ifFalse: [^ false]. + self size = other size ifFalse: [^ false]. + self with: other do: [:e1 :e2 | + (e1 literalEqual: e2) ifFalse: [^ false]]. + ^ true!
Item was added: + ----- Method: LookupKey>>allLiteralsDo: (in category '*Kernel-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 '*Kernel-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!
Hi all --
Note that we must remain cautious to not let Kernel depend on various other packages. In this case, it is okay to let Kernel depend on Collections because it actually does.
We have 7 implementors of #literalEqual: and 8 implementors of #allLiteralsDo:. Not all of them must be in the Kernel package. For example, the following two should remain in their own packages:
ClassBinding >> #literalEqual: (Environments-Core) WrappedBreakpoint >> #allLiteralsDo: (System-Tools)
(In the long term, glue between Kernel, Collections, Files, Chronology, Compiler etc. could be in its own package. Maybe just System. Kernel has still some questionable dependencies. But this is not super urgent :-)
We have a similar situation with the Shout extension point #aboutToStyle: -- 19 implementors -- where any package can choose to integrate with Shout but not make Shout depend on those packages.
In sum, Monticello extension categories (i.e., the ones with an asterisk * followed by package name), are a convenient integration of class extensions into version control - yet - they do not replace a good documentation of other cross-package protocols, not directly supported by Mnticello.
Best, Marcel
Am 02.10.2023 22:46:54 schrieb commits@source.squeak.org commits@source.squeak.org: Eliot Miranda uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-eem.1528.mcz
==================== Summary ====================
Name: Kernel-eem.1528 Author: eem Time: 2 October 2023, 1:46:30.854649 pm UUID: 2d331a30-1cdc-4e20-9f8e-491cf19b43c2 Ancestors: Kernel-mt.1527
allLiteralsDo: and literalEqual: belong in Kernel, not in Collections. Rename Array & LookupKey's literals category to move it to Kernel.
=============== Diff against Kernel-mt.1527 ===============
Item was added: + ----- Method: Array>>allLiteralsDo: (in category '*Kernel-literals') ----- + allLiteralsDo: aBlock + + "I am a literal." + aBlock value: self. + + "All my elements are literals." + self do: [:each | each allLiteralsDo: aBlock].!
Item was added: + ----- Method: Array>>literalEqual: (in category '*Kernel-literals') ----- + literalEqual: other + + self class == other class ifFalse: [^ false]. + self size = other size ifFalse: [^ false]. + self with: other do: [:e1 :e2 | + (e1 literalEqual: e2) ifFalse: [^ false]]. + ^ true!
Item was added: + ----- Method: LookupKey>>allLiteralsDo: (in category '*Kernel-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 '*Kernel-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!
squeak-dev@lists.squeakfoundation.org