 sequences.private strings words definitions macros cpu.architecture
 namespaces arrays quotations combinators sets layouts ;
 QUALIFIED-WITH: alien.c-types c
+QUALIFIED: math.private
 IN: math.vectors.simd.functor
 
 ERROR: bad-length got expected ;

    rep-component-type dup c:c-type-getter-boxer c:array-accessor ;

MACRO: simd-nth ( rep -- x )
    dup simd-nth-fast? [ simd-nth-fast ] [ simd-nth-slow ] if ;

: boa-effect ( rep n -- effect )
    [ rep-components ] dip *

:: define-with-custom-inlining ( word rep class -- )
    word [
        drop
        rep simd-with/nth-fast? [
            [ rep rep-coerce rep (simd-with) class boa ]
        ] [ word def>> ] if
    ] "custom-inlining" set-word-prop ;

: simd-nth-fast ( rep -- quot )
    [ rep-components ] keep
