I am trying to implement an iterator in Julia, but get an exception when the for-loop tries to call start
already.
Here is what I get (I ran include(...), then using RDF
):
julia> methods(start)
# 1 method for generic function "start":
start(graph::Graph) at /Users/jbaran/src/RDF.jl/src/RDF.jl:214
julia> for x in g
println(x)
end
ERROR: `start` has no method matching start(::Graph)
in anonymous at no file
The function definition in the RDF
module looks like this at the moment:
function start(graph::Graph)
return GraphIterator(collect(keys(graph.statements)), nothing, nothing, nothing, [], [])
end
Any idea what I am doing wrong?
start
,done
andnext
did it. I will need to look once more into scoping. Thank you very much! – Verile