Skip to content

Commit

Permalink
build based on bf4ed5c
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jun 4, 2024
1 parent aed69f4 commit f2e65f8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-06-04T16:35:49","documenter_version":"1.4.1"}}
{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-06-04T16:48:56","documenter_version":"1.4.1"}}
2 changes: 1 addition & 1 deletion dev/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
ERROR: MethodError: no method matching bar(::Int64, ::Baz)
Stacktrace:
[1] top-level scope
@ none:1</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Seelengrab/RequiredInterfaces.jl/blob/bf4ed5c2d4572743b561f33012b632eaf49e448d/src/RequiredInterfaces.jl#L225-L268">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="interfaces.html">« About Interfaces</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Tuesday 4 June 2024 16:35">Tuesday 4 June 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
@ none:1</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Seelengrab/RequiredInterfaces.jl/blob/bf4ed5c2d4572743b561f33012b632eaf49e448d/src/RequiredInterfaces.jl#L225-L268">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="interfaces.html">« About Interfaces</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Tuesday 4 June 2024 16:48">Tuesday 4 June 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/examples/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
@required MyInterface myfunc(::MyInterface)

end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Main.A</code></pre><p>That is, one additional <code>using</code>, as well as an invocation of <code>@required</code> with the abstract interface type as well as the function and its signature that&#39;s part of the interface <code>MyInterface</code>.</p><p>With this small change, all issues mentioned above are solvable. First, the ambiguity between &quot;should be implemented&quot; and &quot;not supported&quot; is solved:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using .A</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; struct Foo &lt;: A.MyInterface end</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; A.myfunc(Foo())</code><code class="nohighlight hljs ansi" style="display:block;">ERROR: <span class="sgr31">NotImplementedError: </span>The called method is part of a fallback definition for the `Main.A.MyInterface` interface.
Please implement `myfunc(::MyInterface)` for your type `T &lt;: Main.A.MyInterface`.</code></pre><p>This is because <a href="../api.html#RequiredInterfaces.@required-Tuple{Symbol, Expr}"><code>@required</code></a> defines a fallback method that dispatches to <a href="../api.html#RequiredInterfaces.NotImplementedError"><code>NotImplementedError</code></a>, allowing users that encounter this error to notify the package maintainter that they have missed to implement a required method. Further, because this is an actually thrown error, it&#39;s also discoverable through JET.jl, even without explicit interface testing by implementors.</p><p>In the next section, we&#39;ll take a look at how package authors that would like to hook into an interface can test that they have successfully done so, at least in terms of defining the correct methods.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Main Page</a><a class="docs-footer-nextpage" href="multifuncs.html">Interfaces with multiple functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Tuesday 4 June 2024 16:35">Tuesday 4 June 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Please implement `myfunc(::MyInterface)` for your type `T &lt;: Main.A.MyInterface`.</code></pre><p>This is because <a href="../api.html#RequiredInterfaces.@required-Tuple{Symbol, Expr}"><code>@required</code></a> defines a fallback method that dispatches to <a href="../api.html#RequiredInterfaces.NotImplementedError"><code>NotImplementedError</code></a>, allowing users that encounter this error to notify the package maintainter that they have missed to implement a required method. Further, because this is an actually thrown error, it&#39;s also discoverable through JET.jl, even without explicit interface testing by implementors.</p><p>In the next section, we&#39;ll take a look at how package authors that would like to hook into an interface can test that they have successfully done so, at least in terms of defining the correct methods.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../index.html">« Main Page</a><a class="docs-footer-nextpage" href="multifuncs.html">Interfaces with multiple functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Tuesday 4 June 2024 16:48">Tuesday 4 June 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/examples/multifuncs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
@required LinearArray begin
Base.size(::LinearArray)
Base.getindex(::LinearArray, ::Int)
end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">getindex (generic function with 193 methods)</code></pre><p>Importantly, we <em>don&#39;t need to subtype <code>LinearArray</code></em> in order to check whether a type <em>would</em> implement the interface:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using Test</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; @test RI.check_interface_implemented(LinearArray, Vector)</code><code class="nohighlight hljs ansi" style="display:block;"><span class="sgr32"><span class="sgr1">Test Passed</span></span></code></pre><p>At the moment, this doesn&#39;t handle fallback definitions of abstract types well - for example, if we do the same check with <code>Array</code>, which has a fallback <code>size</code> defined:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using Test</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; @test RI.check_interface_implemented(LinearArray, Array)</code><code class="nohighlight hljs ansi" style="display:block;"><span class="sgr32"><span class="sgr1">Test Passed</span></span></code></pre><p>While unfortunate, this is only a limitation of the current implementation, and should be remedied in the future.</p><p>Another limitation is that we can&#39;t use <code>LinearArray</code> to dispatch <code>Array</code> objects, due to Julia not recognizing that the concrete instantiations of <code>Array</code> (<code>Vector</code> etc.) do implement the interface correctly - this is something that could be remedied with the solution presented in <a href="../interfaces.html#About-Interfaces">About Interfaces</a>, though there are multiple other venues as well.</p><p>For now, checks like these can serve as information on whether a type does conform to the interface correctly, even if it doesn&#39;t formally subtype the abstract type behind this interface.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="basic.html">« Basic Example</a><a class="docs-footer-nextpage" href="testing.html">Testing Required Interfaces »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Tuesday 4 June 2024 16:35">Tuesday 4 June 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">getindex (generic function with 193 methods)</code></pre><p>Importantly, we <em>don&#39;t need to subtype <code>LinearArray</code></em> in order to check whether a type <em>would</em> implement the interface:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using Test</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; @test RI.check_interface_implemented(LinearArray, Vector)</code><code class="nohighlight hljs ansi" style="display:block;"><span class="sgr32"><span class="sgr1">Test Passed</span></span></code></pre><p>At the moment, this doesn&#39;t handle fallback definitions of abstract types well - for example, if we do the same check with <code>Array</code>, which has a fallback <code>size</code> defined:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using Test</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; @test RI.check_interface_implemented(LinearArray, Array)</code><code class="nohighlight hljs ansi" style="display:block;"><span class="sgr32"><span class="sgr1">Test Passed</span></span></code></pre><p>While unfortunate, this is only a limitation of the current implementation, and should be remedied in the future.</p><p>Another limitation is that we can&#39;t use <code>LinearArray</code> to dispatch <code>Array</code> objects, due to Julia not recognizing that the concrete instantiations of <code>Array</code> (<code>Vector</code> etc.) do implement the interface correctly - this is something that could be remedied with the solution presented in <a href="../interfaces.html#About-Interfaces">About Interfaces</a>, though there are multiple other venues as well.</p><p>For now, checks like these can serve as information on whether a type does conform to the interface correctly, even if it doesn&#39;t formally subtype the abstract type behind this interface.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="basic.html">« Basic Example</a><a class="docs-footer-nextpage" href="testing.html">Testing Required Interfaces »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Tuesday 4 June 2024 16:48">Tuesday 4 June 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit f2e65f8

Please sign in to comment.