archives

What is a state?

Here are two versions of the factorial function written in Lisp (MuLisp).
A recursive version:

(DEFUN FACTORIAL (N)
((ZEROP N) 1)
(* N (FACTORIAL (SUB1 N))) )

and an imperative version,

(DEFUN FACTORIAL (N M)
(SETQ M 1)
(LOOP
((ZEROP N) M)
(SETQ M (* N M))
(SETQ N (SUB1 N)) ) )

The imperative version has two mutable states N and M. The way I look at it, the recursive version has a mutable state N. Is there any argument for saying that the recursive version has no state, or no mutable state?