Handbook
Glossary
<ref> ( value c-type -- c-ptr )
Factor handbook
»
C library interface
»
Passing data between Factor and C
»
C value boxes
Next:
deref ( c-ptr c-type -- value )
Vocabulary
alien
.
data
Inputs
value
an
object
c-type
a C type
Outputs
c-ptr
a
c-ptr
Word description
Creates a new byte array to store a Factor object as a C value.
Examples
USING: alien.c-types alien.data prettyprint sequences ; 123 int <ref> length .
4
Definition
USING:
alien.c-types
byte-arrays
kernel
;
IN:
alien.data
:
<ref>
( value c-type -- c-ptr )
[
heap-size
(byte-array)
]
keep
[
[
0
]
]
dip
[
set-alien-value
]
curry
compose
keep
;
inline