48
only if it can prove that there will be no conflict.
Side effects are grouped into classes: ASET, RPLACA and RPLACD (which
are considered distinct), FILE (input/output operations), and CONS. These are
not intended to be exhaustive; there is also an internal notation for "any side-effect whatever". The use of classes enables the analysis to realize, for
example, that RPLACA cannot affect the value of a variable per se. There is a
moderately large body of data in RABBIT about the side-effects of MacLISP
primitive functions. For example, CAR, CDR, CAAR, CADR, and so on are known not
to have side-effects, and to be respectively affected only by RPLACA, RPLACD,
RPLACA, RPLACA or RPLACD, and so on. Similarly, RABBIT knows that ASET' affects
the values of variables, but cannot affect the outcome of a CAR operation. (It
may affect the value of the expression (CAR X), but only because a variable
reference is a subnode of the combination. The effects, or affectability, of a
combination are the union of the effects, or affectibility, of all arguments plus
those of the function.) The CONS side-effect is a special case. This side-effect cannot affect anything, and two instances of it may be performed in the
"wrong" order, but performing a single instance twice will produce distinct (as
determined by EQ) and therefore incorrect results. In particular, closures of
LAMBDA-expressions involve the CONS side-effect. (The definition of SCHEME says
nothing about whether EQ is a valid operation on closures, but in general it is
not a good idea to produce unnecessary multiple copies.) On the other hand,
LAMBDA-expressions occurring in function position of a LAMBDA-combination do not
incur the CONS side-effect. The CONS side-effect is given special treatment in
the optimizer. {Note Side-Effect Classifications}