src/wam/ui.lisp @ fb3a334a14f3

Refactor the shared variables copypasting
author Steve Losh <steve@stevelosh.com>
date Mon, 18 Apr 2016 15:38:02 +0000
parents ce87039ad178
children d8dc03903456
(in-package #:bones.wam)


(defparameter *database* nil)
(defparameter *debug* nil)

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


(defun add-rule (rule)
  (compile-program *database* rule))

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


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

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

(defun dump ()
  (dump-wam-full *database*))