Is there a method that does what magicDo does?
#(#(1 2 true) #(2 1 false)) magicDo: [:a :b :r | "do something useful" ]
"LordGeoffrey" == LordGeoffrey lordgeoffrey@optusnet.com.au writes:
LordGeoffrey> Is there a method that does what magicDo does? LordGeoffrey> #(#(1 2 true) LordGeoffrey> #(2 1 false)) magicDo: [:a :b :r | LordGeoffrey> "do something useful" LordGeoffrey> ] _______________________________________________ LordGeoffrey> Beginners mailing list LordGeoffrey> Beginners@lists.squeakfoundation.org LordGeoffrey> http://lists.squeakfoundation.org/mailman/listinfo/beginners
what do you want a, b, and r to be?
Maybe the values 1, 2, true the first time, and 2, 1, false the second?
If so:
#((1 2 true) (2 1 false)) do: [:row | [:a :b :r | "do something useful" ] valueWithArguments: row. ].
Beware... if your row doesn't have exactly three values, you'll get an exception. If you don't want that, consider #valueWithPossibleArgs:
Prefect. Thanks.
Randal L. Schwartz wrote:
"LordGeoffrey" == LordGeoffrey lordgeoffrey@optusnet.com.au writes:
LordGeoffrey> Is there a method that does what magicDo does? LordGeoffrey> #(#(1 2 true) LordGeoffrey> #(2 1 false)) magicDo: [:a :b :r | LordGeoffrey> "do something useful" LordGeoffrey> ] _______________________________________________ LordGeoffrey> Beginners mailing list LordGeoffrey> Beginners@lists.squeakfoundation.org LordGeoffrey> http://lists.squeakfoundation.org/mailman/listinfo/beginners
what do you want a, b, and r to be?
Maybe the values 1, 2, true the first time, and 2, 1, false the second?
If so:
#((1 2 true) (2 1 false)) do: [:row | [:a :b :r | "do something useful" ] valueWithArguments: row. ].
Beware... if your row doesn't have exactly three values, you'll get an exception. If you don't want that, consider #valueWithPossibleArgs:
beginners@lists.squeakfoundation.org