src/wam/ui.lisp @ 1ab41e0128dc

Add the TRY* instructions to compilation

Still need to implement the actual bytecode.
author Steve Losh <steve@stevelosh.com>
date Wed, 20 Apr 2016 16:33:38 +0000
parents d8dc03903456
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*)))