Handbook
Glossary
interval>literal ( class interval -- literal literal? )
Vocabulary
compiler
.
tree
.
propagation
.
info
Inputs
class
a
class
interval
an
interval
Outputs
literal
a literal value
literal?
a
boolean
Word description
If interval has zero length and the class is sufficiently precise, we can turn it into a literal.
Definition
USING:
accessors
classes.algebra
combinators
kernel
math
math.intervals
sequences
;
IN:
compiler.tree.propagation.info
:
interval>literal
( class interval -- literal literal? )
dup
special-interval?
[
2drop
f
f
]
[
dup
from>>
first
{
{
[
over
interval-length
0
>
]
[
3drop
f
f
]
}
{
[
pick
bignum
class<=
]
[
2nip
>bignum
t
]
}
{
[
pick
integer
class<=
]
[
2nip
>fixnum
t
]
}
{
[
pick
float
class<=
]
[
2nip
[
f
f
]
[
>float
t
]
if-zero
]
}
[
3drop
f
f
]
}
cond
]
if
;