rebuilding repo
[cl-graph.git] / dev / macros.lisp
1 ;;;-*- Mode: Lisp; Package: metabang.graph -*-
2
3 (in-package metabang.graph)
4
5 ;;?? Gary King 2006-01-30: 
6 ;;?? Face it, I have no idea why we need this anymore... but i'm sure we do
7 (defmacro with-changing-vertex ((vertex) &body body)
8   "This is used to maintain consistency when changing the value of vertex elements while iterating over the vertexes..." 
9   (with-variables (v g)
10     `(let* ((,v ,vertex)
11             (,g (graph ,v)))
12        (delete-item-at (graph-vertexes ,g) 
13                        (funcall (vertex-key ,g) (element ,v)))  
14        ,@body
15        (setf (item-at (graph-vertexes ,g) 
16                       (funcall (vertex-key ,g) (element ,v))) ,v))))