;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This file is part of AIslash. ; ; AIslash is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; AIslash is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with AIslash. If not, see . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;

Convenient Glolbals

The ``bald1`` says "N-1 globals is ;better than N. In practice, N can be often be reduced two: one ;for the fixed constants (which I call *f*, for "fixed") and one for the stuff that gets reset ;at the start of each run (which I call *w*, for "working memory"). ;around

(defstruct fixed "fixed stuff"
  (bin-min     0)
  (bin-max   100)
  (bins       10)
  (inf        most-positive-fixnum))

(defstruct wm "runtime working memory"
  (kinds       (make-hash-table))
  (id          0)
  (verticies   (make-hash-table))
  edges
  )

(defparameter *w* (make-wm))
(defparameter *f* (make-fixed))

(defun clears  ()
  (dovalues (v (wm-verticies *w*)) (clear v)))

(defun zap ()
  (setf *w* (make-wm)))