Kemal,

Try:

MyClass class>>createMethod: methodName

self compile: methodName , '
^''this is a code-generated method''' classified: 'generated'.

Make sure you put the method on the class side, or else do a self class compile:classified:

Check out the "Terse Guide to Squeak," attached...

Take care,

Rob

On Fri, Sep 26, 2008 at 3:19 AM, kemal asad-syed <kasadsyed@gmail.com> wrote:
I am trying to add a method to a class using code
let's say if i want to add to the Myclass class the following method:
SelfGeneratedmethode:
^'self generated methode on fri26 sept 2008'.

".
I think with smalltalk it should be possible but i am stuck Any help is welcome. I did
Thanks.
Kemal