In Smalltalk, as in Ruby, just add the useful method to the class. (You could also add the code to an instance, but it is far less common in Smalltalk than in Ruby.)<br><br>You can still put this in a &quot;library.&quot; The de facto library in Squeak is a Monticello package.<br>
<br>You &#39;create&#39; a Monticello package by creating a class category in the browser. (For example, MyApplication-Core or MyApplication-View or MyApplication-Tests).<br><br>Monticello can keep your extensions to other people&#39;s classes by adding a specially named method category. It has to start with an asterisk (*) and then match the first part of your class category. For example, *myapplication or *myapplication-printing<br>
<br>When you share your Monticello .mcz, it will automatically include your classes and any extensions to other classes. I&#39;m using the term extension in a Smalltalky way, as opposed to using the term monkey-patching.<br>
<br>If you are writing an application, usually you will have no problems.<br>
<br>
If you are writing libraries that others will find useful, then you may 
want to &quot;namespace&quot; your methods by adding a prefix indicating your 
application. The Magma OO database defines a method magmaOid on Object 
rather than taking the name oid.<br>
<br>
<br><div class="gmail_quote">On Fri, Mar 19, 2010 at 11:21 AM, sergio_101 <span dir="ltr">&lt;<a href="mailto:sergiolist@village-buzz.com">sergiolist@village-buzz.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
i know there is one in rails.. i might just look at the code and adapt it..<br>
<br>
but.. this makes me wonder..<br>
<br>
since this would probably be a handy function to have in strings...<br>
<br>
should i add it to a personal library/collection, or add it directly<br>
to strings? or extend strings?<br>
<br>
how do smalltalkers usually do this kind thing?<br>
<div class="im"><br>
--<br>
<br>
----<br>
peace,<br>
sergio<br>
photographer, journalist, visionary<br>
<br>
<a href="http://www.coffee-black.com" target="_blank">http://www.coffee-black.com</a><br>
<a href="http://www.painlessfrugality.com" target="_blank">http://www.painlessfrugality.com</a><br>
<a href="http://www.twitter.com/sergio_101" target="_blank">http://www.twitter.com/sergio_101</a><br>
<a href="http://www.facebook.com/sergio101" target="_blank">http://www.facebook.com/sergio101</a><br>
_______________________________________________<br>
</div><div><div></div><div class="h5">Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br>