Actually use current-value->placeholder

This commit is contained in:
Tony Garnock-Jones 2019-08-21 21:20:26 +01:00
parent 79af429b58
commit 27ac21bed1
1 changed files with 38 additions and 34 deletions

View File

@ -143,6 +143,10 @@
(encode-array-like 0 (cons key fields)))
(define (encode-value v)
(match ((current-value->placeholder) v)
[(? integer? n)
(bit-string (#b0001 :: bits 4) (n :: (wire-length)))]
[#f
(match v
[#f (bytes #b00000000)]
[#t (bytes #b00000001)]
@ -180,7 +184,7 @@
[(? set?) (encode-array-like 2 (set->list v))]
[(? dict?) (encode-array-like 3 (dict-keys-and-values v))]
[_ (error 'encode-value "Cannot encode value ~v" v)]))
[_ (error 'encode-value "Cannot encode value ~v" v)])]))
;;---------------------------------------------------------------------------