The Inbox: Collections-ct.859.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Collections-ct.859.mcz

commits-2
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!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.859.mcz

marcel.taeumel
We might want to have a "CollectionsExtras" package? :-D

Best,
Marcel

Am 13.10.2019 22:41:09 schrieb [hidden email] <[hidden email]>:

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!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Collections-ct.859.mcz

Jakob Reschke
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:
We might want to have a "CollectionsExtras" package? :-D

Best,
Marcel

Am 13.10.2019 22:41:09 schrieb [hidden email] <[hidden email]>:

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!