Symbols that start with and uppercase letter

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

Symbols that start with and uppercase letter

nacho
Hi Folks,
I'm trying to generate a collection from all instances of Symbol that begin with a capital letter.
I know how to do this for one case:

| aSymbolArray aSymbol |

aSymbolArray _ Symbol allInstances.
aSymbol _ (aSymbolArray at: 1).
(aSymbol at: 1) isUppercase.

But I want to use something like collect:
| aSymbolArray |

aSymbolArray _ Symbol allInstances.
aSymbolArray collect: [ :a | | aSymbol | aSymbol _ aSymbolArray at: a. (aSymbol at: 1) isUppercase].

But I'm lost.
Any help?
Thanks in advance!
best
Nacho
Nacho Smalltalker apprentice. Buenos Aires, Argentina.
Reply | Threaded
Open this post in threaded view
|

Re: Symbols that start with and uppercase letter

KenD
On Mon, 9 Nov 2015 16:53:16 -0800 (PST)
nacho <[hidden email]> wrote:

> Hi Folks,
> I'm trying to generate a collection from all instances of Symbol that begin
> with a capital letter.

Symbol allInstances select: [ :s | (s size > 0) and: [(s asString at: 1) isUppercase ]].

Cheers,
-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org