The case where the expression substituted for a variable is is a LAMBDA-expression constitutes an instance of procedure integration [Allen and Cocke]. The more general kind of procedure integration proposed in [Declarative], which would involve block compilation of several user functions, and possibly also user declarations or data type analysis, has not been implemented yet.
It would be possible to substitute a LAMBDA-expression for an variable reference in the case of a variable bound by a LABELS. This might be useful in the case of a LABELS produced by a simple-minded FROG macro, which produced a labelled function for each statement of the PROG; in such a case most labelled functions would be referred to only once. We have not implemented this yet in RABBIT. {Note Loop Unrolling}
Currently there is not any attempt to perform the inverse of beta-conversion. This process would be that of locating common subexpressions of some single large expression, making that large expression the body of a LAMBDA- expression of one parameter, replacing all occurrences of the common subexpression by a reference to the parameter, and replacing the large expression by a combination whose function position contained the LAMBDA-expression and whose argument was a copy of the common subexpression. More generally, several common subexpressions could be isolated at once and made into several parameters of the LAMBDA-expression. For example, consider:
(LAMBDA (A B C)
(LIST (/ (+ (- B) (SQRT (- (" B Z) (* 4 A C))))
(* 2 A))
(/ (- (- B) (SORT (- (" B 2) (* 4 A C))))
(* 2 A))))
Within the large expression (LIST ...) we might detect the common subexpressions
(- B), (SQRT ...), and (* 2 A). Thus we would invent three parameters Q1, Q2, Q3
and transform the expression into: