[Pharo-users] About asSymbol message , some questions in my mind

2017-02-10 Thread lb
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





[Pharo-users] About asSymbol message , some questions in my mind

2017-02-10 Thread lb
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




Maybe my understanding is wrong.


Bing Liang





[Pharo-users] About asSymbol message , some questions in my mind

2017-02-11 Thread lb
Thank you, Sven
gradually clear.
1. Symbol as String subclass, only guarantees a symbol object only one in 
system, use ==;
2. keywords (selector name method name)  are spectial symbols, without space or 
forbided characters;
3. perform: aSymbol, means perform: aKeyword,
 Should we add asKeyword to String,
let
perform: aString asKeyword 
 not
perform: aString asSymbol ?


Regards!


Bing Liang


At 2017-02-11 15:51:49, "Sven Van Caekenberghe"  wrote:
>Hi Bing,
>
>Yes, any character is allowed in a Symbol. There is even special syntax that 
>allows such Symbols to be represented literally.
>
>'a b' asSymbol. 
>
>  => #'a b'
>
>Although it might be confusing, I don't see any problem.
>
>The concept of 'meaning' is defined by the user, the usage, not by the Symbol 
>itself. A Symbol with a space cannot be a selector (message/method) name, but 
>that does not mean a Symbol with a space could not be useful in some other 
>context.
>
>Regards,
>
>Sven
>
>> On 11 Feb 2017, at 05:56, lb  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
>> 
>> 
>
>


Re: [Pharo-users] About asSymbol message , some questions in my mind

2017-02-11 Thread lb
Hi Ben,
Thank you very much, your answer make me clear like water.
My question aimed on where, which type errors occur when perform a message.
My usecase.
when perform: aMessage(with a space), get DNU error , cannot find out  by eyes 
directly.


asMessage is better than asSymbol.

Cheers  Bing
At 2017-02-12 00:39:55, "Ben Coman"  wrote:
>Hi Bing Liang,
>
>Thanks for your comments.  Fresh eyes provide interesting perspectives
>on things we take for granted.
>
>On Sat, Feb 11, 2017 at 4:41 PM, lb  wrote:
>> Thank you, Sven
>> gradually clear.
>> 1. Symbol as String subclass, only guarantees a symbol object only one in
>> system, use ==;
>> 2. keywords (selector name method name)  are spectial symbols, without space
>> or forbided characters;
>> 3. perform: aSymbol, means perform: aKeyword,
>
>Not exactly.  It means perform a "message" where there are three types
>of messages...
>* unary, like #printString
>* binary, like #+
>* keyword, like #perform: or
>#subclass:instanceVariableNames:classVariableNames:package:
>having a colon appended to each keyword
>
>>  Should we add asKeyword to String,
>> let
>> perform: aString asKeyword
>
>or alternatively per above...  perform: aString asMessage
>
>>  not
>> perform: aString asSymbol ?
>
>In the case that aString contained a space,
>presumably #asMessage would produce a runtime error in asMessage
>whereas #asSymbol would produce a runtime error in #perform:
>I guess there is a minor benefit of failing early but will that make
>much difference in practice.
>Do you have a use case where it makes a major difference?
>
>
>> At 2017-02-11 15:51:49, "Sven Van Caekenberghe"  wrote:
>>>Hi Bing,
>>>
>>>Yes, any character is allowed in a Symbol. There is even special syntax
>>> that allows such Symbols to be represented literally.
>>>
>>>'a b' asSymbol.
>>>
>>>  => #'a b'
>>>
>>>Although it might be confusing, I don't see any problem.
>>>
>>>The concept of 'meaning' is defined by the user, the usage, not by the
>>> Symbol itself. A Symbol with a space cannot be a selector (message/method)
>>> name, but that does not mean a Symbol with a space could not be useful in
>>> some other context.
>>>
>>>> On 11 Feb 2017, at 05:56, lb  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 common use, so the symbol should
>>>> be composed of alphabet or number ‘without space“.
>
>Different domains have different common usage.
>IIUC, Smalltalk's definition of symbol is from the 1970s.
>Pharo is not overly constrained by Smalltalk traditions, but there
>must be sufficient gain to balance deviations from consistency with
>other Smalltalks.
>
>>>>
>>>> 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
>>>>
>>>>
>>>> Maybe my understanding is wrong.
>
>no problem.  Being wrong is a great way to learn ;)
>
>cheers -ben
>


[Pharo-users] About asSymbol message , some questions in my mind

2017-02-11 Thread lb
Hi, Dnenis
Thank you.

Your sample gives me some tips on AI , NLP. 

Cheers


Bing



在 2017-02-11 22:18:14,"Denis Kudriashov"  写道:



2017-02-11 8:51 GMT+01:00 Sven Van Caekenberghe :
The concept of 'meaning' is defined by the user, the usage, not by the Symbol 
itself. A Symbol with a space cannot be a selector (message/method) name

But it could be:


Point methodDict at: #'name with space' put: Point>>#x.


2@3 perform: #'name with space' "==> 2"


Only problem that we could not use them with normal syntax

Re: [Pharo-users] About asSymbol message , some questions in my mind

2017-02-13 Thread lb
Just To You,  :-)
Symbol  ,  a sign with some meaning in nature language.
eg, #% = percent, #$ = dollar.
but
 2.  '$%%&' asSymbol >>>>no meaning

symbol as a message should have his meaning. defined in its method.
a message should let programmer know what to do.



I come from China , My English is poor.


Cheers.


Bing


在 2017-02-13 07:26:05,"john pfersich"  写道:

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  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







[Pharo-users] If comments seperate from the source code and have your own comments

2015-06-13 Thread lb
Hi,


I know the comment is very important for reading source code and it is also 
important to write your own comment after understand somethings.
I created a rough annotation applicationAnnoApp for Nautilus, please give 
me good advice to improve it.
Attached are the monticello files.
Thank you in advance!


 Liang


PS
I love Smalltalk and I love Pharo.
   




AnnoApp-Pharo4.0.mcz
Description: Binary data


AnnoApp-Pharo5.0 50113.mcz
Description: Binary data


Re: [Pharo-users] If comments seperate from the source code and have your own comments

2015-06-13 Thread lb
Thank you Paul and Stepharo.


AnnoApp is a tool for writting your own comment for Package\Tag\Class\Method.  
seperating from source code file.
Your own annotation can be save out as a file use AnnoEditor.
The  output file can be read back to (new) image according the name of 
Package\Tag\Class\Method if the names still in the (new version) image.  
AnnoEdit can mark or delete the annotations that do not exist in the Image.



for Pharo4.0,
MCHttpRepository location: 'http://smalltalkhub.com/mc/LiangBing64/AnnoApp/main'
 user: ''
 password: ''



Best Regarts!

Liangbing






At 2015-06-14 00:31:05, "Paul DeBruicker"  wrote:
>Hi Liang,
>
>I like that adding Annos don't make the package with the code I'm annotating
>dirty.  
>
>How do I move Annos from one image to another?
>
>The help is in Chinese, is there anything there that a person would need
>that they couldn't figure out from reading hte code?  I found the
>AnnoEditor, which seems nice.
>
>
>Have you put this up on smalltalkhub yet?
>
>
>Thanks for sharing
>
>Paul
>
>
>
>
>BingLiang wrote
>> Hi,
>> 
>> 
>> I know the comment is very important for reading source code and it is
>> also important to write your own comment after understand somethings.
>> I created a rough annotation applicationAnnoApp for Nautilus, please
>> give me good advice to improve it.
>> Attached are the monticello files.
>> Thank you in advance!
>> 
>> 
>>  Liang
>> 
>> 
>> PS
>> I love Smalltalk and I love Pharo.
>>
>> 
>> 
>> 
>> 
>> AnnoApp-Pharo4.0.mcz (36K)
>> ;
>> AnnoApp-Pharo5.0 50113.mcz (36K)
>> ;
>
>
>
>
>
>--
>View this message in context: 
>http://forum.world.st/If-comments-seperate-from-the-source-code-and-have-your-own-comments-tp4832260p4832274.html
>Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Re: [Pharo-users] Literals

2018-04-27 Thread lb
Hi,
I think the question is 
How automaticly create literal's objects , not initialize.
e.g
'aString'
#aSymbol
{ anArray}
#[]



Cheers  Liang



[Pharo-users] Re: Error in Pharo 9 under Windows 10

2021-02-28 Thread lb
Hi Nacho,
Pls update VM
















在 2021-03-01 04:56:04,"Rafael Ignacio Matías Sniechowski" <0800na...@gmail.com> 
写道:

Hi, 
Every time I try to start a Pharo 9 image I get an error. This happens with 
both 32 and 64 bit versions, under Windows 10.
I've tried uninstalling and reinstalling Pharo Launcher without avail.
This has been happening for the last 10 days.
I don't know if this is the proper place to post this...if not please let me 
know.
Attached it's an image with the error I get.


thanks in advance
Nacho




Ignacio Sniechowski