src/wam/ui.lisp @ 79abff72987d

I give up on remembering the name of this file
author Steve Losh <steve@stevelosh.com>
date Fri, 22 Apr 2016 12:39:36 +0000
parents 1ab41e0128dc
children 53d629a6aa69
(in-package #:bones.wam)


(defparameter *database* nil)

(defmacro with-database (&body body)
  `(let ((*database* (make-wam)))
     ,@body))



(defun add-rules (rules)
  (compile-rules *database* rules))

(defun perform-query (query step)
  (run-query *database* query step))


(defmacro rule (&body body)
  `(add-rules '(,body)))

(defmacro rules (&body rules)
  `(add-rules ',rules))

(defmacro query (&body body)
  `(perform-query ',body nil))

(defmacro query-step (&body body)
  `(perform-query ',body t))


(defun dump (&optional full-code)
  (dump-wam-full *database*)
  (when full-code
    (dump-wam-code *database*)))