Tobias Pape uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-topa.1173.mcz==================== Summary ====================
Name: Kernel-topa.1173
Author: topa
Time: 30 May 2018, 4:54:31.858379 pm
UUID: 1327e5ed-7d9c-48d4-8ff9-3d6a41a4ce73
Ancestors: Kernel-mt.1172
SubclassResp #asBit to Boolean (All other Boolean-subclass methods are overrides anyway)
For convenience, add #asNumber/#asInteger for the most common interpretation of booleans as numbers.
=============== Diff against Kernel-mt.1172 ===============
Item was added:
+ ----- Method: Boolean>>asBit (in category 'printing') -----
+ asBit
+ "My numerical interpretation, as one-bit number. This extends nicely to n-bit numbers,
+ as long as they treat 0 as false, and anything else as true"
+ ^ self subclassResponsibility!
Item was added:
+ ----- Method: Boolean>>asInteger (in category 'converting') -----
+ asInteger
+ "It is sufficient to treat this boolean as bit so as to interpret it as a number"
+ ^ self asBit!
Item was added:
+ ----- Method: Boolean>>asNumber (in category 'converting') -----
+ asNumber
+ "It is sufficient to treat this boolean as bit so as to interpret it as a number"
+ ^ self asBit!