[squeak-dev] comparison in a variable

Douglas McPherson djm1329 at san.rr.com
Wed Nov 7 18:13:06 UTC 2012


On Nov 7, 2012, at 10:02 , Joseph J Alotta wrote:

> Greetings,
> 
> I am trying to store a test condition in a variable:
> 
> | test |
> 
> test := '>'.
> 
> ( 5 test 7)  ==> false
> 
> 
> I tried:
> 
> test := $>.

For this style you could say 
test := #>.
5 perform: test withArguments: #(7)


> 
> test := [ :x :y |  x > y ].
> 

Or using a block you could say:
test := [:x :y | x > y].
test value: 5 value: 7

HTH

> 
> How is this done?
> 
> 
> Thank you for your help.
> 
> 
> Sincerely,
> 
> Joe.
> 
> 
> 



More information about the Squeak-dev mailing list