Handbook
Glossary
clip-by-x ( min,max pairs -- pairs' )
Vocabulary
ui
.
gadgets
.
charts
.
lines
.
private
Inputs
min,max
an
object
pairs
an
object
Outputs
pairs'
an
object
Definition
USING:
kernel
math
sequences
;
IN:
ui.gadgets.charts.lines.private
:
clip-by-x
( min,max pairs -- pairs' )
2dup
x-in-bounds?
[
[
dup
first
]
dip
[
search-first?
not
]
keep
adjusted-tail-slice
[
dup
second
]
dip
[
search-first?
not
]
keep
adjusted-head-slice
dup
length
1
>
[
min-max-cut
]
[
nip
]
if
dup
slice?
[
dup
like
]
when
]
[
2drop
{
}
]
if
;