Date: Fri, 23 Aug 96 15:00:03 EDT
From: Peter Shell <NL.CS.CMU.EDU at pshell>
There are a number of other Lisp functions which you may want to
review in your code which are rather cons-heavy and can be replaced
with non-consing function. For example, if you don't need to use
the result of a mapcar function, then use do, dolist or times instead.
Replacing MAPCAR with MAPC is equivalent, but requires less change to
your source.
I've also discovered that (at least in Allegro
4.2), using closures can be cons-intensive and often replacable; for
example, any function such as some or every which takes a function
as an argument.
Starting in 4.3 closures are stack consed if either the compiler can
prove them to be dynamic extent, or if you declare them
DYNAMIC-EXTENT. This greatly reduces consing in some circumstances
without requiring that pretty functional code be rewritten in an
ungly, unclear way.