add [binary format c $v]
}
-# Just add a raw value.
+# v is a complete raw value of the atom.
proc RAW {v} {
upvar buf buf
add $v
char [expr 0x03]
}
+# v is either 16-bytes string, or UUID or uncompressed IP address.
proc HEXLET {v} {
set v [binary decode hex [string map {- "" : ""} $v]]
if {[string length $v] != 16} {
_str [expr {0x80 | 0x40}] [encoding convertto utf-8 $v]
}
+# v is a list of values that will be eval-ed.
proc LIST {v} {
upvar buf buf
char [expr 0x08]
EOC
}
+# a and b are strings that are length-first compared.
proc LenFirstSort {a b} {
set a [encoding convertto utf-8 $a]
set b [encoding convertto utf-8 $b]
error "non-unique keys"
}
+# pairs is a list of key-value values. key is an ordinary string.
+# value will be eval-ed.
proc MAP {pairs} {
set d [dict create]
set keys {}
EOC
}
+# v is a list of strings. It will become a map with NIL values.
proc SET {v} {
set args {}
foreach k $v {
return $v
}
+# v is TAI number of seconds.
proc TAI64 {v {n 0} {a 0}} {
upvar buf buf
set v [expr {$v + (1<<62)}]