BUT There are not compliant below 1. ' ' asSymbol >>>> no meaning 2. '$%%&' asSymbol >>>> no meaning 3. 'sign' asSymbol = 'sign ' asSymbol >>> false because of space. 3. ' one two three ' asSymbol >>> I think It should become three symbols = #one, #two, #three
I don't know what you mean by "no meaning', they're symbols. Try this in a Playground, it works in Pharo 5" | oc sym filtered| oc := ' one two three $%%&' splitOn: ' '. sym := OrderedCollection new. oc do: [:each | sym add: each asSymbol]. filtered := OrderedCollection new. filtered := sym select: [ :each | each ~= #'' ]. Transcript show: sym printString; cr. Transcript show: filtered printString; cr. On Fri, Feb 10, 2017 at 8:56 PM, lb <liangbin...@126.com> wrote: > Hi, > I know Symbol is subclass of String. > Any string object can become symbol object by sending 'asSymbol' message.. > I think symbol must has its meaning in comon use, so the symbol should be > composed of alphabet or number ‘without space“. > > BUT There are not compliant below > 1. ' ' asSymbol >>>> no meaning > 2. '$%%&' asSymbol >>>> no meaning > 3. 'sign' asSymbol = 'sign ' asSymbol >>> false because of space. > 3. ' one two three ' asSymbol >>> I think It should > become three symbols = #one, #two, #three > > > Mybe my understanding is wrong. > > Bing Liang > > >