Most implementations of the language Refal represent ground expressions by doubly-linked lists, which results in low-cost concatenation. On the other hand, that representation necessitates the real copying of expressions in all cases where a variable's value has to be used two or more times. The high cost of copying often prevents the user from writing Refal programs in truly functional style. The paper describes an alternative representation of ground expressions, which allows the copying of expressions to be reduced to copying of pointers to the expressions. The concatenation of expressions, however, becomes more expensive.
Sergei M. Abramov, Sergei A. Romanenko