[cl-unification-cvs] CVS cl-unification

mantoniotti mantoniotti at common-lisp.net
Tue Jan 18 14:48:02 UTC 2011


Update of /project/cl-unification/cvsroot/cl-unification
In directory cl-net:/tmp/cvs-serv18024

Modified Files:
	substitutions.lisp 
Log Message:
Added debugging functions DUMP-FRAME and DUMP-ENVIRONMENT.


--- /project/cl-unification/cvsroot/cl-unification/substitutions.lisp	2009/04/15 10:17:48	1.5
+++ /project/cl-unification/cvsroot/cl-unification/substitutions.lisp	2011/01/18 14:48:02	1.6
@@ -182,6 +182,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 --





More information about the Cl-unification-cvs mailing list