Added debugging functions DUMP-FRAME and DUMP-ENVIRONMENT.
Tue Mar 29 22:59:37 UTC 2011 mantoniotti@common-lisp.net
* Added debugging functions DUMP-FRAME and DUMP-ENVIRONMENT.
diff -rN -u old-cl-unification-1/substitutions.lisp new-cl-unification-1/substitutions.lisp
--- old-cl-unification-1/substitutions.lisp 2013-07-21 19:26:45.000000000 +0000
+++ new-cl-unification-1/substitutions.lisp 2013-07-21 19:26:45.000000000 +0000
@@ -187,6 +187,18 @@
(mapcan #'frame-values (environment-frames env)))
+;;;---------------------------------------------------------------------------
+;;; Simple debugging.
+(defun dump-frame (f &optional (out *standard-output*))
+ (declare (type frame f))
+ (terpri out)
+ (loop for (var . value) in (frame-bindings f)
+ do (format out "~A~VT= ~A~%" var 8 value))
+ )
+
+(defun dump-environment (env &optional (out *standard-output*))
+ (declare (type environment env))
+ (map nil #'(lambda (f) (dump-frame f out)) (environment-frames env)))
;;;; end of file -- substitutions.lisp --