<div class="gmail_quote">On Sat, Jul 25, 2009 at 7:37 AM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Yeah, I discovered these strange customs with<br>
<a href="http://bugs.squeak.org/view.php?id=7352" target="_blank">http://bugs.squeak.org/view.php?id=7352</a><br>
To me, the whole API looks hackish and messy, but it seems to be used,<br>
so will be hard to remove...</blockquote><div><br></div><div>The reason they&#39;re used is that they are the easiest way to create methods which do the right thing with optional parameters. Now perhaps the &quot;right thing&quot; to do would be add a feature to the parser that allowed methods to &quot;degrade&quot; such that:</div>
<div><br></div><div>foo:withBar:andNarf:  </div><div><br></div><div>can be</div><div><br></div><div>foo:withBar:</div><div><br></div><div>and</div><div><br></div><div>foo:</div><div><br></div><div>or event possibly</div><div>
<br></div><div>foo</div><div><br></div><div>rather than having to write 4 separate methods.  It is incredibly useful when you have say block closures stuck in a dictionary that has the block closures swapped out based on the behavior of those blocks.  Where would you ever use such at thing?  Poker playing AI!  Seriously, if you&#39;re implementing a system that can play a game like &quot;Follow the Queen&quot; , the rules of the game change based on what cards are showing.  The easiest way to implement this is to swap out  individual rules when some events happen.  </div>
<div><br></div><div>But discussions like this go nowhere fast :)  For example:</div><div><br></div><div><a href="http://www.cincomsmalltalk.com/userblogs/rademers/blogView?showComments=true&amp;entry=3285925252">http://www.cincomsmalltalk.com/userblogs/rademers/blogView?showComments=true&amp;entry=3285925252</a> </div>
<div><br></div><div>and</div><div><br></div><div><a href="http://www.smalltalk.org/articles/article_20050216_a1.html">http://www.smalltalk.org/articles/article_20050216_a1.html</a></div><div><br></div><div>actually its a shame the discussion hasn&#39;t been more vigorous :)</div>
<div><br></div><div>Dave</div><div><br></div><div><br></div></div>-=-=-=-=-=-=-=-=-=-=- <a href="http://blog.dloh.org/">http://blog.dloh.org/</a><br>