X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=dev%2Fgraph.lisp;h=98049a7ea80114b55ff6f5b22ac6c63b603755f6;hb=63b8fd870436113d8d196d94f1e6f2eabfe7f786;hp=8531652c920f8c9cae32c3ccc8869036eaa2acb9;hpb=18871eadb3f0704f6211e68fea61ed9043209885;p=cl-graph.git diff --git a/dev/graph.lisp b/dev/graph.lisp index 8531652..98049a7 100644 --- a/dev/graph.lisp +++ b/dev/graph.lisp @@ -198,7 +198,8 @@ something is putting something on the vertexes plist's ;;; internals ;;; --------------------------------------------------------------------------- -(defmethod add-vertex ((graph basic-graph) (value basic-vertex) &key if-duplicate-do) +(defmethod add-vertex + ((graph basic-graph) (value basic-vertex) &key if-duplicate-do) (declare (ignore if-duplicate-do)) (values value)) @@ -1025,9 +1026,10 @@ length" ;;; --------------------------------------------------------------------------- -(defun map-shortest-paths (graph start-vertex depth fn &key (filter (constantly t))) +(defun map-shortest-paths + (graph start-vertex depth fn &key (filter (constantly t))) "Apply fn to each shortest path starting at `start-vertex` of depth `depth`. The `filter` predicate is used to remove vertexes from consideration." - (bind ((visited (make-container 'simple-associative-container + (let ((visited (make-container 'simple-associative-container :test #'equal))) (labels ((visit (p) (setf (item-at-1 visited p) t))