[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FIXNUM-restricted versions of rational funs
- Subject: Re: FIXNUM-restricted versions of rational funs
- From: Jon L White <JONL at MIT-MC>
- Date: Sat ,24 Jan 81 06:43:00 EDT
I'd like to say a word *for* names like IMIN, IMAX, and IGCD
(or why not even MIN&, MAX& and GCD& for fixnum functions; and
MIN$ and MAX$ for flonum functions?) Note: I'm not favoring
the change of / to \, but merely admitting some alternate naems.
If there are no objections, we should add some such names to the
initial MacLISP list structure, even if they only default to being
the same as MIN, MAX and \.
Now a word of caution about names like "Ixxx". INTERLISP uses
this style to mean "Arguments are to be 'integerized' and integer
arithmetic is to be used" (since INTERLISP doesn't have 'bignums',
the restriction to 'integers' is the same as the restriction to
'fixnums'). The problem with this is that each argument must still
be run-time interpreted (i.e., decide if it is a number, check if
it is floating, and convert to fixed if so, etc etc). In short,
the compiler can't fully open-code it. Partly to avoid mnemonic
conflict with the INTERLISP conventions, I'd not like to see
IMIN, IMAX and IGCD used.
** I strongly reccommend ** that some series of names be provided
merely to mean "2's complement, computer rational arithmetic". For
just gazillions of applications, the substitution of these operations
for integer operations is fully satisfactory. The same can be
said for "2's complement, computer floating-point arithmetic".
At one time, MacLISP tried to out-do APL, so many of these functions
got 1- or 2-character names; but how about it, how about choosing
the convention of suffixing a & to mean fixnum-only, and suffixing
a $ to mean flonum-only? Even when there is no particular
machine instruction generall provided (e.g., what machine has
a GCD instruction??), this is still worthwhile as a succinct way
to locally declare arithmetic modes.