Re: [Pharo-users] Problems evaluating message sends in run-time arrays

2015-02-12 Thread stepharo


Le 11/2/15 02:38, Andy Burnett a écrit :

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.


Why do you rely on text when you can talk to objects?
Open an inspector and get the full power :)


What surprised me was that:

charList := {Character digitValue:35. Character digitValue:33.}.

Does evaluate to an array of two characters.  What is going on?


andy inspect the result and you will see that you get an array with two 
character.


Color blue
print
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.





Cheers
Andy
ᐧ




Re: [Pharo-users] Problems evaluating message sends in run-time arrays

2015-02-11 Thread 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


Re: [Pharo-users] Problems evaluating message sends in run-time arrays

2015-02-10 Thread Sean P. DeNigris
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.





-
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/Problems-evaluating-message-sends-in-run-time-arrays-tp4805048p4805060.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Problems evaluating message sends in run-time arrays

2015-02-10 Thread Ignacio Sniechowski
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 
andy.burn...@knowinnovation.com wrote:

 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
 ᐧ



Re: [Pharo-users] Problems evaluating message sends in run-time arrays

2015-02-10 Thread Ben Coman
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 ColorprintOn:
cheers -ben

On Wed, Feb 11, 2015 at 9:38 AM, Andy Burnett 
andy.burn...@knowinnovation.com wrote:

 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
 ᐧ



[Pharo-users] Problems evaluating message sends in run-time arrays

2015-02-10 Thread Andy Burnett
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
ᐧ


Re: [Pharo-users] Problems evaluating message sends in run-time arrays

2015-02-10 Thread Ignacio Sniechowski
| 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 
andy.burn...@knowinnovation.com wrote:

 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
 ᐧ