Skip to content

Commit

Permalink
Regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Jan 18, 2024
1 parent 8c76a63 commit 576a6b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions book/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ <h2 id="javascript-external-functions"><a class="header" href="#javascript-exter
}
</code></pre>
<pre><code class="language-gleam">// In src/my_program.gleam
@external(javascript, &quot;./my-module.js&quot; &quot;run&quot;)
@external(javascript, &quot;./my-module.js&quot;, &quot;run&quot;)
pub fn run() -&gt; Int
</code></pre>
<p>Gleam uses the JavaScript import syntax, so any module imported must use the
Expand All @@ -1381,16 +1381,16 @@ <h2 id="javascript-external-functions"><a class="header" href="#javascript-exter
<h2 id="multi-target-external-functions"><a class="header" href="#multi-target-external-functions">Multi-target external functions</a></h2>
<p>An external implementation can be provided for multiple targets by given the
<code>@external</code> attribute multiple times.</p>
<pre><code class="language-gleam">@external(erlang, &quot;rand&quot; &quot;uniform&quot;)
@external(javascript, &quot;./my-module.js&quot; &quot;random&quot;)
<pre><code class="language-gleam">@external(erlang, &quot;rand&quot;, &quot;uniform&quot;)
@external(javascript, &quot;./my-module.js&quot;, &quot;random&quot;)
pub fn random() -&gt; Float
</code></pre>
<p>The appropriate implementation will be chosen based on the target the program is
being compiled for.</p>
<h2 id="gleam-fallbacks"><a class="header" href="#gleam-fallbacks">Gleam fallbacks</a></h2>
<p>A Gleam implementation can be given as a fallback for when no external
implementation has been specified for the current target.</p>
<pre><code class="language-gleam">@external(erlang, &quot;lists&quot; &quot;reverse&quot;)
<pre><code class="language-gleam">@external(erlang, &quot;lists&quot;, &quot;reverse&quot;)
pub fn reverse(items: List(a)) -&gt; List(a) {
do_reverse(items, [])
}
Expand Down
2 changes: 1 addition & 1 deletion book/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion book/searchindex.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions book/tour/external-functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ <h2 id="javascript-external-functions"><a class="header" href="#javascript-exter
}
</code></pre>
<pre><code class="language-gleam">// In src/my_program.gleam
@external(javascript, &quot;./my-module.js&quot; &quot;run&quot;)
@external(javascript, &quot;./my-module.js&quot;, &quot;run&quot;)
pub fn run() -&gt; Int
</code></pre>
<p>Gleam uses the JavaScript import syntax, so any module imported must use the
Expand All @@ -211,16 +211,16 @@ <h2 id="javascript-external-functions"><a class="header" href="#javascript-exter
<h2 id="multi-target-external-functions"><a class="header" href="#multi-target-external-functions">Multi-target external functions</a></h2>
<p>An external implementation can be provided for multiple targets by given the
<code>@external</code> attribute multiple times.</p>
<pre><code class="language-gleam">@external(erlang, &quot;rand&quot; &quot;uniform&quot;)
@external(javascript, &quot;./my-module.js&quot; &quot;random&quot;)
<pre><code class="language-gleam">@external(erlang, &quot;rand&quot;, &quot;uniform&quot;)
@external(javascript, &quot;./my-module.js&quot;, &quot;random&quot;)
pub fn random() -&gt; Float
</code></pre>
<p>The appropriate implementation will be chosen based on the target the program is
being compiled for.</p>
<h2 id="gleam-fallbacks"><a class="header" href="#gleam-fallbacks">Gleam fallbacks</a></h2>
<p>A Gleam implementation can be given as a fallback for when no external
implementation has been specified for the current target.</p>
<pre><code class="language-gleam">@external(erlang, &quot;lists&quot; &quot;reverse&quot;)
<pre><code class="language-gleam">@external(erlang, &quot;lists&quot;, &quot;reverse&quot;)
pub fn reverse(items: List(a)) -&gt; List(a) {
do_reverse(items, [])
}
Expand Down

0 comments on commit 576a6b5

Please sign in to comment.