Handbook
Glossary
monad? ( object -- ? )
Vocabulary
monads
Inputs and outputs
object
an
object
?
a
boolean
Word description
Tests if the object is an instance of the
monad
class.
Definition
USING:
classes.tuple.private
kernel
kernel.private
math.private
slots.private
ui.gadgets
ui.gadgets.controls
;
IN:
monads
:
monad?
( object -- ? )
dup
tag
2
eq?
[
drop
t
]
[
dup
dup
tuple?
[
layout-of
dup
7
slot
dup
\
reader
eq?
[
drop
t
]
[
dup
\
state
eq?
[
drop
t
]
[
\
identity
eq?
]
if
]
if
[
drop
t
]
[
dup
1
slot
9
fixnum>=
[
9
slot
\
gadget
eq?
]
[
drop
f
]
if
]
if
]
[
drop
f
]
if
[
drop
t
]
[
dup
gadget-monad?
[
drop
t
]
[
dup
writer-monad?
[
drop
t
]
[
dup
reader-monad?
[
drop
t
]
[
dup
state-monad?
~quotation~ ~quotation~
if
]
if
]
if
]
if
]
if
]
if
;