<div dir="ltr">Only tangentially related but I can't resist. Here's my least-favorite hack... pure evil. What was that thing uncle Ben said about power?<div><br></div><div style>someObject perform: ('foo' , 'Bar') asSymbol. "There are no senders of #fooBar! Oh wait..."</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 31, 2013 at 8:30 PM, Casey Ransberger <span dir="ltr"><<a href="mailto:casey.obrien.r@gmail.com" target="_blank">casey.obrien.r@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Totally. Also, one might argue that switching on type isn't terribly object-oriented. Or rather, it sort of re-implements dispatch. Sometimes it's hard to avoid, but some hard things are worth doing. Of course I'm a big fat hypocrite once in a long while (DNU hacks, #isKindOf:, etc.)<div>
<br></div><div>#respondsTo: is nicer in some spots. Protocol isn't class. Etc.<br><div><br></div><div>+1</div></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Sat, Aug 31, 2013 at 7:39 PM, tim Rowledge <span dir="ltr"><<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There are 623 senders of isKindOf: in the 4.5 image I'm using right now - which may be more than the general because I have some extra stuff loaded - and I'd bet that there are no more than a dozen places where it is actually a sensible way of doing what is needed.<br>
<br>
It's slow - it scans up a class tree.<br>
It's ugly.<br>
It isn't actually testing what a lot of people seem to think - if you want to find out is some object can handle a certain capability try actually asking with something like #isAGraphicThing rather than (isKindOf: Morph) or:[ foo isKindOf: DisplayObject] blahblahblah.<br>
<br>
We can do better.<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" target="_blank">http://www.rowledge.org/tim</a><br>
Useful random insult:- Paralyzed from the neck up.<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Casey Ransberger
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Casey Ransberger
</div>