Handbook
Glossary
write-integer ( n type -- )
Vocabulary
cbor
.
private
Inputs
n
an
object
type
an
object
Outputs
None
Definition
USING:
cbor
combinators
endian
io
kernel
math
;
IN:
cbor.private
:
write-integer
( n type -- )
5
shift
{
{
[
over
24
<
]
[
bitor
write1
]
}
{
[
over
255
<=
]
[
24
bitor
write1
write1
]
}
{
[
over
65535
<=
]
[
25
bitor
write1
2
>be
write
]
}
{
[
over
4294967295
<=
]
[
26
bitor
write1
4
>be
write
]
}
{
[
over
18446744073709551615
<=
]
[
27
bitor
write1
8
>be
write
]
}
[
-5
shift
2
+
192
bitor
write1
dup
bit-length
8
/mod
zero?
[
1
+
]
unless
>be
write-cbor
]
}
cond
;