OO in Python? ^^

Alex Martelli aleax at mail.comcast.net
Thu Dec 15 01:06:44 EST 2005


<bonono at gmail.com> wrote:

> Alex Martelli wrote:
> > <bonono at gmail.com> wrote:
> >
> > > > those convoluted templates that were added to the language as
> > > > an afterthought.
> > > I don't see this in Haskell.
> >
> > Well, historically templates HAVE been added to Haskell "as an
> > afterthought" (well after the rest of the language was done), and
> > judging mostly from
> > <http://research.microsoft.com/~simonpj/papers/meta-haskell/meta-haskell
> > .ps> it doesn't seem unfair to call them "convoluted"...
> >
> I think I was talking about the need to add templates in order for
> writing generic functions that was mentioned(see the example given
> about sum), not in the context you are talking about. You seem to have
> skipped the other half of the text I quoted.

Right, you can get good genericity with Haskell's typeclasses (I've
posted about that often in the past, and desperately and so far
unsuccessfully tried to convince Guido to use something close to
typeclasses rather than "interfaces" for such purposes as PEP 246
[protocol adaptation]); it's the state of _templates_ in Haskell,
specifically, which I was rather dubious about (it may be that I just
haven't dug into them deep enough yet, but they do seem not a little
"convoluted" to me, so far).


Alex



More information about the Python-list mailing list