0

I'm building a graph editor with Piccolo2D and want to implement Loom's Graph protocol. However I run into problem

Unable to resolve symbol: out-edges in this context 

What really confusing is that I can use successors in has-edge.

(extend-type PCanvas Graph (nodes [g] (->children (->node-layer g))) (edges [g] (->children (->edge-layer g))) (has-node? [g node] (some #{node} (nodes g))) (has-edge? [g n1 n2] (some #{n2} (successors g n1))) (successors ([g] (partial successors g)) ([g node] (remove (partial = node) (distinct (flatten (apply concat (map ->nodes (out-edges g node)))))))) (out-degree [g node] (count (out-edges g node))) (out-edges [g node] (->edges node))) 

So in what condition protocol methods can call others?

Edit: Full error message: http://pastebin.com/NDWEZZ7y

2
  • Normally (iirc) protocol implementations should be able to call the protocol methods themselves freely. Can you post the full error message? Commented May 2, 2014 at 4:58
  • Yep, that's what I thought too. I added the full error message. Commented May 2, 2014 at 5:08

2 Answers 2

2

I released Loom version 0.5.0 which includes the multigraph support.

Sign up to request clarification or add additional context in comments.

Comments

1

There is no such method in the current release, 0.4.2, which is 4 months old, see https://github.com/aysylu/loom/blob/0.4.2/src/loom/graph.clj#L13. You are probably looking at the master branch in GitHub, changes made 23 days ago, not yet in a release.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.