Handbook
Glossary
index>position ( i gb -- pos )
Vocabulary
gap-buffer
Inputs
i
an
object
gb
an
object
Outputs
pos
an
object
Definition
USING:
accessors
kernel
math
;
IN:
gap-buffer
:
index>position
( i gb -- pos )
2dup
valid-index?
[
2dup
gap-end>>
>=
[
gap-length
-
]
[
drop
]
if
]
[
index-out-of-bounds
]
if
;