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! |
We might want to have a "CollectionsExtras" package? :-D Best, Marcel
|
Maybe separate the domains not basically concerned with "Collections": - text (words, capitalization, lines, line endings, collation, display - or put the latter into Graphics) - encoding (mime, base64, check sums, markup, watch out for Multilingual) - natural language (spelling, stemming etc) - code (selectors, identifiers, camel case) - file system paths ... Marcel Taeumel <[hidden email]> schrieb am Mi., 16. Okt. 2019, 11:07:
|
Free forum by Nabble | Edit this page |