[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SIDE-EFFECT-FREE/STATELESS Functions
From: IN%"edsel!jonl@labrea.stanford.EDU" "Jon L White" 13-MAY-1988 06:32
Subj: SIDE-EFFECT-FREE/STATELESS Functions
The discussion on "constant functions" seems to me to have reached a
dead end.
Agreed. But I do maintain that the 'inline' declaration would
be significantly more useful if the single word "desirable"
is changed to "allowable" in specifying its effect. This would
create a more appropriate division of responsibility between
the compiler and the programmer. No Common Lisp implementation
or program would have to be modified to implement this refinement
of the standard. In the future compilers would be encouraged
to make a reasonable context dependand decision about open coding.
Would it be desirable to have two new declarations: SIDE-EFFECT-FREE and
STATELESS?
I am in favor of such declarations. Presumably one would want a
compiler to try to verify these properties. Should "ERROR" and
"CERROR" be considered side effect free for this purpose?
If not then functions like division can't be considered side
effect free, since division by zero must signal an error.
Of course, if a compiler can check these properties it could
also compute them. But currently it would not be allowed
to use those computed properties.