【发布时间】:2014-07-30 03:58:48
【问题描述】:
我正在尝试在 Julia 中实现迭代器,但是当 for 循环尝试调用 start 时出现异常。
这是我得到的(我运行了 include(...),然后是 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
RDF 模块中的函数定义现在是这样的:
function start(graph::Graph)
return GraphIterator(collect(keys(graph.statements)), nothing, nothing, nothing, [], [])
end
知道我做错了什么吗?
【问题讨论】:
标签: julia