[Newbies] Re: Perform
me at zulq.net
Mon Jan 14 14:53:14 UTC 2008
And, instead of concatenating your selector with ':', you can send a
symbol the message #asMutator (which does it for you).
#phone1 asMutator "prints #phone1:"
#phone2 asMutator "prints #phone2:"
Which you can use like this:
phoneBook perform: aSelector asMutator with: aValue
Mathieu Suen wrote:
> Hi Jakub,
> #perform: is for unary message
> If you want to pass arguments you have to use
> #perform:with: "On argument"
> #perform:with:with: "Two arguments"
> #perform:withArguments: "Several arguments inside an Array"
> so in your case it should be:
> phonebook perform: #phone1 with: aValue
> On Jan 14, 2008, at 2:58 PM, Jakub wrote:
>> hello i have class with two setters
>> phone1: aValue
>> phone2: aValue
>> and i want call it dynamically
>> aSelector is phone1 or phone2 string
>> setPhohne: aSelector by: aValue
>> phoneBook perform aSelector, ':' aValue
>> but this is not working how can i do this when i try this iwth getters
>> it works fine
>> Transcript show: (phoneBook perform aSelector); cr.
>> Jakub. _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
More information about the Beginners