[squeak-dev] The Inbox: Collections-ct.859.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Oct 13 20:41:01 UTC 2019
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.859.mcz
==================== Summary ====================
Name: Collections-ct.859
Author: ct
Time: 13 October 2019, 10:40:56.879932 pm
UUID: 5e8fabca-af4e-c640-b6fd-95ebf4a6e424
Ancestors: Collections-ct.858
Proposal: Add string converters #asClassName and #asSelector
I am aware of #asIdentifier: as well as #asLegalSelector, but this proposal supports readable and convenient selectors
=============== Diff against Collections-ct.858 ===============
Item was added:
+ ----- Method: String>>asClassName (in category 'converting') -----
+ asClassName
+
+ ^ (self findFeatures collect: #withFirstCharacterUpshifted) join!
Item was added:
+ ----- Method: String>>asSelector (in category 'converting') -----
+ asSelector
+
+ | features |
+ features := self findFeatures.
+ features ifEmpty: [^ Symbol empty].
+ ^ ((features allButFirst collect: #withFirstCharacterUpshifted)
+ copyWithFirst: features first asLowercase)
+ join asSymbol!
More information about the Squeak-dev
mailing list
|