aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-03-17 17:06:18 +0000
committerLouis Pilfold <louis@lpil.uk>2024-03-17 17:06:18 +0000
commitf4695499a9850bdec6570b226bd8f30e5446ddc7 (patch)
tree7e7ba8c03327720ac7a1c08be67508a3b3e0d396 /src
parente5019e5496d27c8c0c56f0510a88cc4fa693ce53 (diff)
downloadtour-f4695499a9850bdec6570b226bd8f30e5446ddc7.tar.gz
tour-f4695499a9850bdec6570b226bd8f30e5446ddc7.zip
More info on bit arrays
Closes https://github.com/gleam-lang/language-tour/issues/58
Diffstat (limited to 'src')
-rw-r--r--src/content/chapter3_data_types/lesson08_bit_arrays/en.html20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/content/chapter3_data_types/lesson08_bit_arrays/en.html b/src/content/chapter3_data_types/lesson08_bit_arrays/en.html
index cd6733a..8b92335 100644
--- a/src/content/chapter3_data_types/lesson08_bit_arrays/en.html
+++ b/src/content/chapter3_data_types/lesson08_bit_arrays/en.html
@@ -8,7 +8,10 @@
</p>
<ul>
<li><code>size</code>: the size of the segment in bits.</li>
- <li><code>unit</code>: how many times to repeat the segment.</li>
+ <li>
+ <code>unit</code>: the number of bits that the <code>size</code> value is a
+ multiple of.
+ </li>
<li><code>bits</code>: a nested bit array of any size.</li>
<li><code>bytes</code>: a nested byte-aligned bit array.</li>
<li><code>float</code>: a 64 bits floating point number.</li>
@@ -19,8 +22,23 @@
<li><code>utf8</code>: utf8 encoded text.</li>
<li><code>utf16</code>: utf16 encoded text.</li>
<li><code>utf32</code>: utf32 encoded text.</li>
+ <li><code>utf8_codepoint</code>: a utf8 codepoint.</li>
+ <li><code>utf16_codepoint</code>: a utf16 codepoint.</li>
+ <li><code>utf32_codepoint</code>: a utf32 codepoint.</li>
+ <li><code>signed</code>: a signed number.</li>
+ <li><code>unsigned</code>: an unsigned number.</li>
</ul>
<p>
+ Multiple options can be given to a segment by separating each with a dash:
+ <code>x:unsigned-little-size(2)</code>.
+</p>
+<p>
Bit arrays have limited support when compiling to JavaScript, not all options
can be used. Full bit array support will be implemented in the future.
</p>
+<p>
+ For more information on bit arrays see the
+ <a href="https://www.erlang.org/doc/programming_examples/bit_syntax.html"
+ >Erlang bit syntax documentation</a
+ >.
+</p>