Howto add a method programatically

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Howto add a method programatically

Alex Schenkman
Hi list,

I'm using Pharo 1.2.1.
How can I add a method programatically (with code)?
Where do I find information about it?

Thanks in advance!

Reply | Threaded
Open this post in threaded view
|

Re: Howto add a method programatically

Igor Stasenko
On 29 June 2011 18:44, Alex Schenkman <[hidden email]> wrote:
> Hi list,
> I'm using Pharo 1.2.1.
> How can I add a method programatically (with code)?
> Where do I find information about it?
> Thanks in advance!
>

MyClass compile: 'newMethod ^ 1 + 1 '

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Howto add a method programatically

Mariano Martinez Peck


On Wed, Jun 29, 2011 at 7:04 PM, Igor Stasenko <[hidden email]> wrote:
On 29 June 2011 18:44, Alex Schenkman <[hidden email]> wrote:
> Hi list,
> I'm using Pharo 1.2.1.
> How can I add a method programatically (with code)?
> Where do I find information about it?
> Thanks in advance!
>

MyClass compile: 'newMethod ^ 1 + 1 '


yes, and you can also check the friends of #compile:  that are in the same category. You can specify notifiers, category, etc, etc.
 
--
Best regards,
Igor Stasenko AKA sig.




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Howto add a method programatically

Stéphane Ducasse
the compileSilently: will not log your changes if you need that.

On Jun 29, 2011, at 8:01 PM, Mariano Martinez Peck wrote:

>
>
> On Wed, Jun 29, 2011 at 7:04 PM, Igor Stasenko <[hidden email]> wrote:
> On 29 June 2011 18:44, Alex Schenkman <[hidden email]> wrote:
> > Hi list,
> > I'm using Pharo 1.2.1.
> > How can I add a method programatically (with code)?
> > Where do I find information about it?
> > Thanks in advance!
> >
>
> MyClass compile: 'newMethod ^ 1 + 1 '
>
>
> yes, and you can also check the friends of #compile:  that are in the same category. You can specify notifiers, category, etc, etc.
>  
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>