Handbook
Glossary
init-struct ( class with-prototype: ( prototype -- alien ) sans-prototype: ( class -- alien ) -- alien )
Vocabulary
classes
.
struct
.
private
Inputs
class
an
object
with-prototype
a
quotation
with stack effect
( prototype -- alien )
sans-prototype
a
quotation
with stack effect
( class -- alien )
Outputs
alien
an
object
Definition
USING:
classes.struct
kernel
;
IN:
classes.struct.private
:
init-struct
( class with-prototype: ( prototype -- alien ) sans-prototype: ( class -- alien ) -- alien )
[
[
[
[
struct-prototype
]
]
]
dip
]
dip
[
?if
]
2curry
compose
keep
memory>struct
;
inline