How to remove a method programatically

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

How to remove a method programatically

Rob Rothwell
Does anyone know a good way to remove a method from an object programatically?

For example

ArbitraryObject removeMethod: #method1.

There are many "...Refactory...." or "...Refactoring" objects out there, but I can't seem to figure any of them out...

Rob

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to remove a method programatically

Rob Rothwell
Never mind, I guess...one more try got me:

RefactoringBrowser new removeMethodsSafe: #(#method1) from: ArbitraryObject.

Rob


On Wed, May 21, 2008 at 8:43 AM, Rob Rothwell <[hidden email]> wrote:
Does anyone know a good way to remove a method from an object programatically?

For example

ArbitraryObject removeMethod: #method1.

There are many "...Refactory...." or "...Refactoring" objects out there, but I can't seem to figure any of them out...

Rob


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to remove a method programatically

Randal L. Schwartz
>>>>> "Rob" == Rob Rothwell <[hidden email]> writes:

Rob> Never mind, I guess...one more try got me:
Rob> RefactoringBrowser new removeMethodsSafe: #(#method1) from: ArbitraryObject.

Well, that's a higher-level view.  But whenever you think "methods" think
"Behavior" class, because (nearly) anything that has a method dictionary
eventually inherits from there.  Notice the protocol category "adding/removing
methods", and below that, #removeSelector:.  It even has a comment, although
that's about traits. :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to remove a method programatically

Rob Rothwell
On Wed, May 21, 2008 at 9:46 AM, Randal L. Schwartz <[hidden email]> wrote:
Well, that's a higher-level view.  But whenever you think "methods" think
"Behavior" class, because (nearly) anything that has a method dictionary
eventually inherits from there.  

Thanks...this is a good place to look...
 
Rob

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners