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

Re: Open-coding, and proliferation of function names

Although this discussion started out over MOON's observation
(10 years late!) that MAX and MIN are still not open-coded
in MacLISP, the general question came up about function names
for the "fixnum-only" versions of arithmetic.
    Date: 2 December 1980 18:41-EST
    From: Kent M. Pitman <KMP at MIT-MC>
    Subject:  Special names for Open-Coded Functions
	Date: 2 December 1980 1034-EST (Tuesday)
	From: Guy.Steele at CMU-10A
	To:   Moon@AI, Bug-Lisp
	Re:   MAX not open-coded
    .  .  .
In some kind of theoretical discussion, it might be nice to remark that 
GREATERP and MAX can be based solely over the generic functions along with 
type information, what conceivable practical value would accrue by flushing 
the type-specific names, or by turning them into macros which generate the
type-declared generic code?  You'd still have names like "<" and "<$" (the 
latter for flonum LESSP -- useful primarily on machines like the VAX where 
floating-point comparisons cannot be done with the same instructions as 
fixed-point comparisons).
    But in fact you go way astray in picking PLUS for an example -- the
"+" function is significantly different from PLUS.  There is no way
to make a mechanical conversion from "+" into PLUS, since the former
is some kind of modular arithmetic, and the latter is one-to-one.  It is 
primarily a convenience for efficiency that a programmer can substitute "+"
for PLUS, when he knows that the two will have the same result over the
paritcular limited domain of application.