Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-15 Thread stepharo
Good idea! Stef Le 8/4/16 09:49, Cyril Ferlicot Delbecque a écrit : On 08/04/2016 09:05, Henrik Nergaard wrote: | s1 s2 | s1 := 1234 asString. s2 := 1234 asString. s1 = s2. "true" s1 == s2. "false" s1 asSymbol = s2 asSymbol. "true" s1 asSymbol == s2 asSymbol. "true" (s1 class allInstances

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-08 Thread Cyril Ferlicot Delbecque
On 08/04/2016 09:05, Henrik Nergaard wrote: > | s1 s2 | > > s1 := 1234 asString. > s2 := 1234 asString. > > s1 = s2. "true" > s1 == s2. "false" > > s1 asSymbol = s2 asSymbol. "true" > s1 asSymbol == s2 asSymbol. "true" > > (s1 class allInstances select: [:s | s = s1 ]) size. "2" > (s1 asSymbo

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-08 Thread stepharo
+1 | s1 s2 | s1 := 1234 asString. s2 := 1234 asString. s1 = s2. "true" s1 == s2. "false" s1 asSymbol = s2 asSymbol. "true" s1 asSymbol == s2 asSymbol. "true" (s1 class allInstances select: [:s | s = s1 ]) size. "2" (s1 asSymbol class allInstances select: [:s | s = s1 asSymbol ]) size. "1" [

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-08 Thread Sven Van Caekenberghe
> On 08 Apr 2016, at 09:19, Damien Cassou wrote: > > Henrik Nergaard writes: > >> | s1 s2 | >> >> s1 := 1234 asString. >> s2 := 1234 asString. >> >> s1 = s2. "true" >> s1 == s2. "false" >> >> s1 asSymbol = s2 asSymbol. "true" >> s1 asSymbol == s2 asSymbol. "true" >> >> (s1 class allInstanc

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-08 Thread Damien Cassou
Henrik Nergaard writes: > | s1 s2 | > > s1 := 1234 asString. > s2 := 1234 asString. > > s1 = s2. "true" > s1 == s2. "false" > > s1 asSymbol = s2 asSymbol. "true" > s1 asSymbol == s2 asSymbol. "true" > > (s1 class allInstances select: [:s | s = s1 ]) size. "2" > (s1 asSymbol class allInstances sel

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-08 Thread Henrik Nergaard
@lists.pharo.org] On Behalf Of Ben Coman Sent: Friday, April 8, 2016 3:23 AM To: Any question about pharo is welcome Subject: Re: [Pharo-users] Pharo-users Question about the symbols A symbol is like a string, except that all symbols with the same value are in fact the same object; that is,

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-07 Thread Cyril Ferlicot
On Friday, 8 April 2016, Valentin Ryckewaert wrote: > Hello everyone, > > i'm learning Pharo and i'm having difficulties to understand the symbols, > what are they? How are they different of the ByteString ? Why are they > usefull ? > Why should I put #string where I can put 'string' ? > Hi, As

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-07 Thread Brad Selfridge
And symbols are immutable Brad Sent from my iPad > On Apr 7, 2016, at 9:41 PM, Markus Stumptner wrote: > > As a result, internal names (e.g., method names) are usually symbols. Strings > are normally used for string manipulation, symbols for unambiguous (but > humanly readable!) internal r

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-07 Thread Markus Stumptner
As a result, internal names (e.g., method names) are usually symbols. Strings are normally used for string manipulation, symbols for unambiguous (but humanly readable!) internal reference (vulgo 'naming'). Markus On 08/04/16 10:53, Ben Coman wrote: A symbol is like a string, except that all

Re: [Pharo-users] Pharo-users Question about the symbols

2016-04-07 Thread Ben Coman
A symbol is like a string, except that all symbols with the same value are in fact the same object; that is, every #hello symbol is the exact same object as every other #hello symbol. See "identically equal" section here... http://sdmeta.gforge.inria.fr/FreeBooks/ByExample/08%20-%20Chapter%206%20-

[Pharo-users] Pharo-users Question about the symbols

2016-04-07 Thread Valentin Ryckewaert
Hello everyone, i'm learning Pharo and i'm having difficulties to understand the symbols, what are they? How are they different of the ByteString ? Why are they usefull ? Why should I put #string where I can put 'string' ? Thanks in advance for your answer. Valentin Ryckewaert