I would like to create an array with a collection of colour values.
I tried both: colorList := {Color blue} and colourList := {Color named: #blue.}. In both cases it evaluates to 'Color blue' rather than the Color object. What surprised me was that: charList := {Character digitValue:35. Character digitValue:33.}. Does evaluate to an array of two characters. What is going on? Cheers Andy ᐧ |
| colorList | colorList := [ Color blue class ] value. Lic. Ignacio Sniechowski, MBA Prosavic SRL Tel: (011) 4542-6714 On Tue, Feb 10, 2015 at 10:38 PM, Andy Burnett <[hidden email]> wrote:
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
|
In reply to this post by Andy Burnett
or | colorList | colorList := { Color blue class }. Lic. Ignacio Sniechowski, MBA Prosavic SRL Tel: (011) 4542-6714 On Tue, Feb 10, 2015 at 10:38 PM, Andy Burnett <[hidden email]> wrote:
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
|
Administrator
|
In reply to this post by Andy Burnett
'Color blue' is the Color object you created and put in your array. It is aColor object. It's print string is 'Color blue'. See Color>>#printOn: for more info.
Cheers,
Sean |
In reply to this post by Andy Burnett
I'm away from my Pharo computer to double-check, but is it just that is how a Color object displays itself ? Maybe have a look at Color>>printOn: cheers -ben On Wed, Feb 11, 2015 at 9:38 AM, Andy Burnett <[hidden email]> wrote:
|
In reply to this post by Andy Burnett
ᐧ Sean P. DeNigris wrote <<< Andy Burnett wrote > In both cases it evaluates to 'Color blue' rather than the Color object. 'Color blue' is the Color object you created and put in your array. It is aColor object. It's print string is 'Color blue'. See Color>>#printOn: for more info. >>> Ah, of course! I completely misunderstood what the inspector was telling me. Thanks very much |
In reply to this post by Andy Burnett
Le 11/2/15 02:38, Andy Burnett a
écrit :
Why do you rely on text when you can talk to objects? Open an inspector and get the full power :)
andy inspect the result and you will see that you get an array with two character. Color blue Color blue because Color blue is a color which corresponds exactly to the result of sending the message blue to Color. Some meta approach: Color blue hue Color blue intensity if it replies to color message, it is a color.
|
Free forum by Nabble | Edit this page |