[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: number crunching

    Date: Mon, 5 Oct 1992 18:18:01 +0100
    From: Jonathan Bachrach <Jonathan.Bachrach@ircam.fr>
    The problem with this approach is that the user has to meticulously
    copy and type each of the methods.  This is completely dissatisfactory.
    An alternative approach found in OOSL's (e.g., C++, Eiffel, and
    Sather) is to parameterize the class by the type of the element.
    These classes get instantiated at compile time and separate copies are
    automatically generated with the proper typing.  This makes it very
    convenient to construct very efficient objects.

Another way to achieve the same end is with macros.  With
a decent macro system, there's never any reason to copy code.

Often, you can even do this with C's not-quite-macros.

This also gives you control over just which methods you
generate, and when you fall back on generic arithmetic.
With multimethods, you potentially have combinatorically
many methods to generate, but you may only need a few
of them.