<br><br><div class="gmail_quote">On 9 November 2010 19:27, Andrew Turley <span dir="ltr"><<a href="mailto:aturley@acm.org">aturley@acm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Just to be contrarian here, I would like to point out that<br>
"instanceof" and run-time type checking are generally considered a bad<br>
idea in OO languages. Take a look at these to start:<br>
<a href="http://c2.com/cgi/wiki?InstanceofInConditionals" target="_blank">http://c2.com/cgi/wiki?InstanceofInConditionals</a><br>
<a href="http://www.artima.com/intv/constP.html" target="_blank">http://www.artima.com/intv/constP.html</a> (see the section "When to Use RTTI")<br></blockquote><div><br></div><div>I take it that by OO -here- you mean languages like C++ and Java, and not something like Scheme which is extremely OO (functions and primitives are objects there too, unlike in ChucK).</div>
<div><br></div><div>If so, and I'm not terribly misunderstanding something, then yes, it probably is... but then those languages are typically used in a context of writing code, compiling it and having a executable. Compared to them we are relatively focussed on adding to a running program and editing it, something that is typically used in very different sorts of languages.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Maybe you could argue that for quick scripts the benefits outweigh the<br>
problems, but I think I would look harder for an OO solution. Granted,<br>
Chuck has somewhat limited support for OO, so maybe we just don't have<br>
the tools we need for a better solution (multiple-inheritance [also<br>
problematic], dynamic dispatch, type-safe downcasts, interfaces, etc).<br>
<br>
I'm not trying to make the great the enemy of the good here, I'm just<br>
saying that there might be better ways of solving this problem, at<br>
least from a software engineering standpoint.<br><br></blockquote><div><br></div><div>I'd be very enthusiastic  about a better solution to the issue; I just made some stuff up that sounded convenient. One of the things that affects this and that affects livecoding is the namespace which much of the time gets in our way. If there are other ways of determining the nature of some object we wouldn't need to do this.... Or we could have some sort of way that would allow us to try doing things to objects where we are unsure of their capabilities and not have the whole thing come crashing down.</div>
<div><br></div><div>I'm not too attached to the proposed solution, any other way of dealing with the problem would also be fine.</div><div><br></div><div>Kas.</div></div>