about summary refs log tree commit diff
path: root/pkgs/profpatsch/netencode/spec.md
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-06-22 13:39:15 +0200
committerProfpatsch <mail@profpatsch.de>2020-06-22 13:39:15 +0200
commitba416c3aa04407df7dc1c2b06ef4a02b1d18654a (patch)
tree87e93d525e7e2d7b3f0c1c1965708bc314f5a65a /pkgs/profpatsch/netencode/spec.md
parentf77c71721f8786f64684d6c543c7962ffa0e3c16 (diff)
pkgs/profpatsch/netencode: add support for bool
Instead of adding a new type, it just uses the 2^1 natural, which has
exactly two possibilities.
Diffstat (limited to 'pkgs/profpatsch/netencode/spec.md')
-rw-r--r--pkgs/profpatsch/netencode/spec.md12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/profpatsch/netencode/spec.md b/pkgs/profpatsch/netencode/spec.md
index cd38588c..e680034f 100644
--- a/pkgs/profpatsch/netencode/spec.md
+++ b/pkgs/profpatsch/netencode/spec.md
@@ -31,8 +31,18 @@ An implementation can define the biggest numbers it supports, and has to throw a
 
 Floats are not supported, you can implement fixed-size decimals or ratios using integers.
 
+### booleans
+
+A boolean is represented as `n1`.
+
+* `n1:0,`: false
+* `n1:1,`: true
+
+TODO: should we add `f,` and `t,`?
+
 ### text
 
+
 Text (`t`) that *must* be encoded as UTF-8, starting with its length in bytes:
 
 * The string `hello world` (11 bytes): `t11:hello world,`
@@ -40,7 +50,7 @@ Text (`t`) that *must* be encoded as UTF-8, starting with its length in bytes:
 * The string `:,` (2 bytes): `t2::,,`
 * The empty sting `` (0 bytes): `t0:,`
 
-Binary data is not supported, it hinders human readability. Try to use structured data, or use a different format.
+TODO: add `b` for binary content. Even filesystem paths are not utf-8 encodable sometimes, yet the distinction of text with an encoding is useful, so we should keep `t` as is.
 
 ## tagged values