6b2403fb07d8

Add break to run
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 29 Mar 2016 23:09:51 +0000
parents 3ac6e0d897af
children 894cac6a43fa
branches/tags (none)
files examples/ggp.lisp src/paip-compiled.lisp src/wam/compile.lisp

Changes

--- a/examples/ggp.lisp	Mon Mar 28 20:32:33 2016 +0000
+++ b/examples/ggp.lisp	Tue Mar 29 23:09:51 2016 +0000
@@ -235,5 +235,5 @@
 
 (fresh-depth-charge!)
 (time
-  (dotimes (i 10)
+  (dotimes (i 100000)
     (fresh-depth-charge!)))
--- a/src/paip-compiled.lisp	Mon Mar 28 20:32:33 2016 +0000
+++ b/src/paip-compiled.lisp	Tue Mar 29 23:09:51 2016 +0000
@@ -471,3 +471,5 @@
 
 (defmacro ?- (&rest goals)
   `(top-level-prove ',(replace-wildcard-variables goals)))
+
+
--- a/src/wam/compile.lisp	Mon Mar 28 20:32:33 2016 +0000
+++ b/src/wam/compile.lisp	Tue Mar 29 23:09:51 2016 +0000
@@ -222,11 +222,12 @@
       generate-program-actions))
 
 
-(defun run (wam instructions)
+(defun run (wam instructions &optional step)
   "Execute the machine instructions on the given WAM."
   (mapc (lambda (action)
           (when (not (wam-fail wam))
-            (apply (car action) wam (cdr action))))
+            (apply (car action) wam (cdr action))
+            (when step (break))))
         instructions)
   (values))