[Shootout-list] Re: OO (was Re: process creation & message passing)

Aaron Denney wnoise@ofb.net
Thu, 21 Oct 2004 16:59:41 +0000 (UTC)


On 2004-10-21, Isaac Gouy <igouy2@yahoo.com> wrote:
>> Isaac likes to poke fun at himself for crafting the Clean OO test
>> example, but I think it's valid to treat Type classes as a hierarchy
>> in the same way as an object system. 
>
> In an object system you don't have to hard-code super class calls!

Except in C++'s constructors, calling the superclasses's version of the
overridden methods, etc.

With Haskell's typeclasses, anyway, you do get calling some super-class
methods for free.  You only "inherit" from what are essentially abstract
classes, but when definining an instance of Ord I can call (==) for my
instance, even if I haven't defined it -- I can rely on the definition
of the superclass Eq that defines it as (a == b = not (a /= b))

>> They are two ways of dealing with the same problem.
> They are two *different* ways.
>
> Why reject iterative solutions for fibo and ackermann?
> They are two ways of dealing with the same problem.

If a language doesn't have recursion, and needs to simulate it, managing
it's own stack, maybe I'd accept it.  It would, of course, have to
recurse down both sub-branches, the way the current tests do.

>> It's a moot point.  Someone already wrote such an entry.  It's here,
>> and it's going to stay.
>
> It would be disapointing to grandfather carelessness and errors of
> judgement. Shouldn't we bring back the C# programs because they were
> once shown on the Shootout pages?

Do we have a free C# compiler?

-- 
Aaron Denney
-><-