3 ms·
First off lisp does have state. It isn't a pure language. That aside there are several approaches. The easiest is to thread state that is have a function that
by stonemetal 18y ago
First off lisp does have state. It isn't a pure language. That aside there are several approaches. The easiest is to thread state that is have a function that looks like
update Worldstate = do userinput <- getUserinput;
Worldstate' <- updateworldstate userinput worldstate;
drawworldstate worldstate';
update worldstate';