Handbook
Glossary
struct-slot-spec
Vocabulary
classes
.
struct
Definition
USING:
slots
;
IN:
classes.struct
TUPLE:
struct-slot-spec
<
slot-spec
type packed?
;
Methods
USING:
accessors
alien
alien.c-types
classes.struct
classes.struct.private
kernel
;
M:
struct-slot-spec
(reader-quot)
[
offset>>
]
[
type>>
]
bi
'[
>c-ptr
_
_
alien-value
]
;
USING:
accessors
alien
alien.arrays
alien.c-types
arrays
classes.struct
classes.struct.private
combinators.short-circuit
kernel
;
M:
struct-slot-spec
(writer-quot)
[
offset>>
]
[
type>>
]
bi
[
'[
>c-ptr
_
_
set-alien-value
]
]
keep
dup
lookup-c-type
{
[
array?
]
[
string-type?
not
]
}
1&&
[
heap-size
'[
[
_
check-struct-array-length
]
dip
]
prepose
]
[
drop
]
if
;
USING:
accessors
alien.c-types
classes.struct
classes.struct.private
kernel
math
;
M:
struct-slot-spec
compute-slot-offset
[
over
c-type-align-at
8
*
align
]
keep
[
[
8
/i
]
dip
offset<<
]
[
type>>
heap-size
8
*
+
]
2bi
;