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

Re: small integers



    Define a module that imports the Dylan module variable "+" under the name 
    "generalized+" and the Dylan module variable "fix+" as "+" ...


Hmmm...maybe.  There would be a bunch of substitutions to make in the
module header -- not just +.

The problem is to make this easy enough so that the C programmers will feel
that they can get the efficient policy they want without a lot of
complicated gyrations.  This kind of module hackery is certainly more
hassle than just changing the overflow policy with a declaration, but maybe
it can be turned into a no-brainer -- just insert this magic header and the
module becomes fixnum-only.  It would be essential to pre-define all the
generic functions for fixnum-only arithmetic, and to make sure the compiler
understands what to do with them.

A disadvantage is that the whole module would have to have a single default
policy for overflow-handling.  You couldn't switch back and forth for
certain critical functions.  But maybe that's OK.

I'm not crazy about this way of doing it, but it could work.

-- Scott
===========================================================================
Scott E. Fahlman
School of Computer Science
Carnegie Mellon University
5000 Forbes Avenue
Pittsburgh, PA 15213

Internet: sef+@cs.cmu.edu