Handbook
Glossary
[vconvert] ( from-element to-element from-size to-size from-type to-type -- quot )
Vocabulary
math
.
vectors
.
conversion
.
private
Inputs
from-element
an
object
to-element
an
object
from-size
an
object
to-size
an
object
from-type
an
object
to-type
an
object
Outputs
quot
an
object
Definition
USING:
accessors
combinators
kernel
math.vectors.simd
math.vectors.simd.intrinsics
;
IN:
math.vectors.conversion.private
::
[vconvert]
( from-element to-element from-size to-size from-type to-type -- quot )
{
{
[
from-element to-element
eq?
]
[
[
]
]
}
{
[
from-element to-element
[
float-type?
not
]
both?
]
[
[
underlying>>
to-type
boa
]
]
}
{
[
from-element
float-type?
]
[
from-type
new
simd-rep
[
[
underlying>>
]
]
dip
[
(simd-v>integer)
to-type
boa
]
curry
compose
]
}
{
[
to-element
float-type?
]
[
from-type
new
simd-rep
[
[
underlying>>
]
]
dip
[
(simd-v>float)
to-type
boa
]
curry
compose
]
}
}
cond
[
from-type
check-vconvert-type
]
prepose
;