Handbook
Glossary
read-bare ( schema -- obj )
Binary Application Record Encoding (BARE)
Next:
bare> ( encoded schema -- obj )
Vocabulary
bare
Inputs
schema
schema
Outputs
obj
an
object
Word description
Decodes an object that was serialized in the BARE format using
schema
, reading from an
input-stream
.
Definition
IN:
bare
GENERIC:
read-bare
( schema -- obj )
Methods
USING:
bare
combinators
io
kernel
;
M:
bool
read-bare
drop
read1
{
{
0
[
f
]
}
{
1
[
t
]
}
[
throw
]
}
case
;
USING:
accessors
bare
io
kernel
;
M:
data
read-bare
length>>
[
read
]
[
uint
read-bare
read
]
if*
;
USING:
accessors
assocs
bare
kernel
;
M:
enum
read-bare
[
uint
read-bare
]
dip
values>>
?value-at
[
invalid-enum
]
unless
;
USING:
bare
endian
io
kernel
math
;
M:
f32
read-bare
drop
4
read
le>
bits>float
;
USING:
bare
endian
io
kernel
math
;
M:
f64
read-bare
drop
8
read
le>
bits>double
;
USING:
bare
endian
io
kernel
;
M:
i16
read-bare
drop
2
read
signed-le>
;
USING:
bare
endian
io
kernel
;
M:
i32
read-bare
drop
4
read
signed-le>
;
USING:
bare
endian
io
kernel
;
M:
i64
read-bare
drop
8
read
signed-le>
;
USING:
bare
endian
io
kernel
;
M:
i8
read-bare
drop
1
read
signed-le>
;
USING:
bare
kernel
math
;
M:
int
read-bare
drop
uint
read-bare
dup
odd?
[
1
+
neg
]
when
2
/i
;
USING:
accessors
bare
kernel
sequences
;
M:
list
read-bare
[
length>>
[
uint
read-bare
]
unless*
]
[
type>>
[
read-bare
]
curry
replicate
]
bi
;
USING:
accessors
arrays
bare
kernel
sequences
;
M:
map
read-bare
[
uint
read-bare
]
dip
[
from>>
]
[
to>>
]
bi
[
[
read-bare
]
bi@
2array
]
2curry
replicate
;
USING:
accessors
bare
kernel
;
M:
optional
read-bare
u8
read-bare
1
=
[
type>>
read-bare
]
[
drop
f
]
if
;
USING:
bare
io.encodings.string
io.encodings.utf8
kernel
;
M:
str
read-bare
drop
T{
data
}
read-bare
utf8
decode
;
USING:
accessors
assocs
bare
;
M:
struct
read-bare
fields>>
[
read-bare
]
assoc-map
;
USING:
bare
endian
io
kernel
;
M:
u16
read-bare
drop
2
read
le>
;
USING:
bare
endian
io
kernel
;
M:
u32
read-bare
drop
4
read
le>
;
USING:
bare
endian
io
kernel
;
M:
u64
read-bare
drop
8
read
le>
;
USING:
bare
io
kernel
;
M:
u8
read-bare
drop
read1
;
USING:
bare
io
kernel
math
;
M:
uint
read-bare
drop
0 0
[
read1
[
127
bitand
rot
[
7
*
shift
bitor
]
keep
1
+
swap
]
[
128
bitand
zero?
not
]
bi
]
loop
nip
;
USING:
accessors
assocs
bare
kernel
;
M:
union
read-bare
[
uint
read-bare
]
dip
members>>
?value-at
[
read-bare
]
[
invalid-union
]
if
;
USING:
bare
kernel
;
M:
void
read-bare
drop
f
;