diff options
Diffstat (limited to 'lessons/src/lesson036_bit_arrays')
-rw-r--r-- | lessons/src/lesson036_bit_arrays/code.gleam | 13 | ||||
-rw-r--r-- | lessons/src/lesson036_bit_arrays/text.html | 26 |
2 files changed, 0 insertions, 39 deletions
diff --git a/lessons/src/lesson036_bit_arrays/code.gleam b/lessons/src/lesson036_bit_arrays/code.gleam deleted file mode 100644 index dc772ca..0000000 --- a/lessons/src/lesson036_bit_arrays/code.gleam +++ /dev/null @@ -1,13 +0,0 @@ -import gleam/io - -pub fn main() { - // 8 bit int. In binary: 00000011 - io.debug(<<3>>) - io.debug(<<3>> == <<3:size(8)>>) - - // 16 bit int. In binary: 0001100000000011 - io.debug(<<6147:size(16)>>) - - // A bit array of UTF8 data - io.debug(<<"Hello, Joe!":utf8>>) -} diff --git a/lessons/src/lesson036_bit_arrays/text.html b/lessons/src/lesson036_bit_arrays/text.html deleted file mode 100644 index 3214db1..0000000 --- a/lessons/src/lesson036_bit_arrays/text.html +++ /dev/null @@ -1,26 +0,0 @@ -<p> - Bit arrays represent a sequence of 1s and 0s, and are a convenient syntax for - constructing and manipulating binary data. -</p> -<p> - Each segment of a bit array can be given options to specify the representation - used for that segment. -</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>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> - <li><code>int</code>: an int with a default size of 8 bits.</li> - <li><code>big</code>: big endian.</li> - <li><code>little</code>: little endian.</li> - <li><code>native</code>: the endianness of the processor.</li> - <li><code>utf8</code>: utf8 encoded text.</li> - <li><code>utf16</code>: utf16 encoded text.</li> - <li><code>utf32</code>: utf32 encoded text.</li> -</ul> -<p> - Bit arrays have limited support when compiling to JavaScript, not all options - can be used. Full bit array support will be implemented in future. -</p> |