|
RE: >> notation: msg#00189lang.smalltalk.squeak.beginners
Dave > You mention the browser, how would I use it to understand the > MyClass>>doThis statement? Or is this even a good example for > understanding > ">>"? MyClass>>doThis is not a statement of the Smalltalk language it is just notation, a way to say (or write) the contents (or definition) of a method. When you write: MyClass>>doThis array := Array new: 3. array at: 1 put: 2. It means that if you browse to the class MyClass, then to the method whose selector is #doThis you will find: doThis array := Array new: 3. array at: 1 put: 2. Another example, if I include in a mail the following text: String>>sameAs: aString "Answer whether the receiver sorts equal to aString. The collation sequence is ascii with case differences ignored." ^(self compare: aString caseSensitive: false) = 2 It means that I am (may be) asuming that the class String exists, that it has a method whose selector is #sameAs: and it's definition is: sameAs: aString "Answer whether the receiver sorts equal to aString. The collation sequence is ascii with case differences ignored." ^(self compare: aString caseSensitive: false) = 2 Try it, go and find the method sameAs: of the class String. I hope this helps. Emilio
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: >> notation, Ramon Leon |
|---|---|
| Next by Date: | Re: >> notation, Joe Koberg |
| Previous by Thread: | RE: >> notation, Ramon Leon |
| Next by Thread: | Re: >> notation, Stuart Herring |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |