Best formalism to define the interface
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- julia
调研方向
首先审阅此 issue 中提出的接口选择,以及其中引用的 Graphs.jl pull request #262。比较无方法函数和默认错误这两种方案,以及链接的 Interfaces.jl 和 InterfaceSpecs.jl 选项。当维护者就新 API 的形式体系达成一致并完成文档记录后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
When we define the new API, there will be abstract types with some methods that must be implemented. In base Julia, I see two main ways of specifying this (as in, defining the function name, possibly with a generic docstring):
julia> function myfunc1 end
myfunc1 (generic function with 0 methods)
julia> myfunc2(args...) = error("Not implemented")
myfunc2 (generic function with 1 method)
julia> myfunc1(1)
ERROR: MethodError: no method matching myfunc1(::Int64)
Stacktrace:
[1] top-level scope
@ REPL[4]:1
julia> myfunc2(1)
ERROR: Not implemented
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] myfunc2(args::Int64)
@ Main ./REPL[2]:1
[3] top-level scope
@ REPL[5]:1
I believe a methodless function is better than a single method throwing an error by default. The end result is nearly the same in terms of user experience, but I find the first error clearer because it directly tells you what to implement. @simonschoelly what do you think?
Of course we could also consider more advanced options like Interfaces.jl or InterfaceSpecs.jl but maybe it's a bit overkill?
- 主要语言
- Julia
- 星标
- 11
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
JuliaGraphs/GraphsBase.jl 的其他 Issue
-
question
难度 5/5 一周以上 新手友好度 25/100
JuliaGraphs/GraphsBase.jl#34 ·
-
question
难度 5/5 一周以上 新手友好度 15/100
JuliaGraphs/GraphsBase.jl#28 ·
-
question
难度 5/5 一周以上 新手友好度 25/100
JuliaGraphs/GraphsBase.jl#27 · 1 条评论 · 1 个 reaction ·
-
question
难度 5/5 一周以上 新手友好度 22/100
JuliaGraphs/GraphsBase.jl#26 · 6 条评论 · 2 个 reaction ·
-
question
难度 5/5 一周以上 新手友好度 25/100
JuliaGraphs/GraphsBase.jl#25 · 3 条评论 · 1 个 reaction ·
查看 JuliaGraphs/GraphsBase.jl 的全部 Issue
相似的 Issue
-
`SplitRungeKutta` time steppers never call `update_lagrangian_particle_state!`, so particle `tracked_fields` are never updated可能已有人在做 @ali-ramadhan 今天认领。 未关闭bug 🐞
难度 2/5 1-3 小时 新手友好度 76/100
CliMA/Oceananigans.jl#6381 ·
维护者通常 1 天内回复
-
ci system:windows test
难度 1/5 1 小时以内 新手友好度 76/100
维护者通常 1 天内回复
-
Single-column TKE example: boundary-layer depth description doesn't match Han & Bretherton (2019)未关闭
难度 1/5 1-3 小时 新手友好度 82/100
NumericalEarth/Breeze.jl#1143 ·
维护者通常 1 天内回复
-
format-check (Runic) is red on master: formatter drift on ~200 files可能已有人在做 @ChrisRackauckas-Claude 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
SciML/ModelingToolkit.jl#5337 · 1 条评论 ·
维护者通常 3 天内回复
-
bug parsers
难度 2/5 1-3 小时 新手友好度 72/100
lanl-ansi/GasModels.jl#366 ·