Now we're passing the name of a variable rather
than the number. We can now create a number of
accumulator generators. However, the syntax is
ugly, and it's not something we'd want to code
often. This seems a pity.

CONCLUSION

The problem is intended to emphasize the features
of LISP, and in particular lexical binding and
higher order functions. Indirectly it illustrates
Greenspun's Rule:

Any sufficiently complicated C or Fortran
program contains an ad hoc, informally
specified, bug-ridden, slow implementation of
half of common lisp.

Put another way, the limit case for implementing
the accumulator generator in sh is to turn it into
a lisp dialect by, say, writing a shell builtin to
evaluate a lisp type expression, or add lexical
binding to the shell. It's interesting to note,
from reading about lisp recently, that lisp used
dynamic binding until the introduction of scheme
during the 1970s, and all dialects of lisp
eventually adopted it.