On 11/05/2013 12:48, Clément Bera wrote:
Hello,
The method that exists is #withArgs:executeMethod: so replace "executeMethod: someCode" ==> by ==> "withArgs: #( ) executeMethod: someCode" or create the method: Object>>executeMethod: compiledMethod ^ self withArgs: #( ) executeMethod: compiledMethod Then it should work.
You're the second one to ask that question I will make a fix. Are you in Pharo 2 or Pharo 3 ?
Pharo 2.0. It's certainly not a stopper as one can always do <code>ProfStef next.</code>. However since the lesson is about reflection, it somehow feels weird :-)
#perform: is different. #perform: takes a selector as argument and the lookup will find out the method to execute, whereas executeMethod: directly run a method with no lookup (which can lead to a crash if the receiver cannot run properly this method).
2013/11/5 Joachim Tuchel <jtuchel@objektfabrik.de <mailto:jtuchel@objektfabrik.de>>
Hi,
I am not sure whether Pharo implements or once implemented a special method like executeMethod: but in Smalltalk the selector for sending a message to an object is #perform: so you should probably try to replace #executeMethod with #perform: . But I am sure somebody more familiar with ProfStef and Pharo will comment on your issue more specifically.
HTH,
Joachim
Am 05.11.13 07:36, schrieb Bahman Movaqar:
Hi all,
Reading ProfStef at lesson 25 (Reflections), when I try to run the last statement <code>ProfStef default executeMethod: (ProfStef lookupSelector:#next).</code>, the error pops up saying <error>Unknown selector executeMethod:</error>. Am I doing anything wrong?
-- Bahman Movaqar (http://BahmanM.com) ERP Evaluation, Implementation & Deployment Consultant PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)