#| Working compatibly with acl2 gets rid of oop sort of except in as much as having a von neumann state object is oop. There are packages, I guess. In the car game (I don't like automobiles so I will eventually rename this something like robot-game) my system is like this (defsystem "car-game" :components ((:file "packages") (:file "macros" :depends-on ("packages")) (:file "side-effects" :depends-on ("macros")) (:file "car-game" :depends-on ("side-effects")))) Where :car-game has been nicknamed to :acl2-user so the logical files, "macros.lisp" and "car-game.lisp" can be loaded just like this: acl2 <<EOG (include-book "macros" :uncertified-okp t) (include-book "car-game" :uncertified-okp t) EOG Eventually I will add an acl2 book module to the system definition probably mostly for documentation. The objects as such are stobjs (which are secretly just very particular lists I think), which is passed into and then a new version out from pseudo-stateful functions, like this (using the seq macro rather than a stobj proper) |# (defmacro seq (stobj &rest rst) (cond ((endp rst) stobj) ((endp (cdr rst)) obj) (t `(let ((,stobj ,(car rst))) (seq ,stobj ,@(cdr rst)))))) (defun reset (stobj) (declare (ignore stobj)) (list (list 'nodes))) (defun add-node (stobj row col) (list (append (assoc 'nodes stobj) `(((row . ,row) (co. . ,col)))))) (seq stobj (reset stobj) (add-node stobj 1 2) (add-node stobj 3 4)) #| -> (((row . 1) (col . 2)) ((row . 3) (col . 4))) In a throw back to scm's wumpus hunting guide, since I decided future-non-automobile-robots will move between a hypergrid of nodes, I added a graphviz dot language visualizer. I didn't realize before that without the -T argument, graphviz dot outputs a textual description of where it would decide to put its nodes. That's crazy useful for making dumb terminal ascii graphviz graphs, or something like an SDL2 program literally using the graph clustering. |# #| Addendum: I put acl2-primitives in side-effects (Maybe defining some acl2-primitives is a side effect ;p) |#