Handbook
Glossary
offset-of-slot ( name tuple -- n )
Vocabulary
classes
.
tuple
Inputs
name
a
string
tuple
a
tuple
Outputs
n
an
integer
Word description
Returns the offset of a tuple slot accessed by
name
.
Errors
Throws a
no-slot
error if no slot with that name.
Definition
USING:
kernel
;
IN:
classes.tuple
:
offset-of-slot
( name tuple -- n )
2dup
?offset-of-slot
[
2nip
]
[
no-slot
]
if*
;