 
 ERROR: integer-length-expected obj ;
 
+#! The check-length call forces partial dispatch
 : check-length ( n -- n )
     dup integer? [ integer-length-expected ] unless ; inline
 

<PRIVATE

: ((each)) ( seq -- n quot )
    [ length ] keep [ nth-unsafe ] curry ; inline

: (each) ( seq quot -- n quot' )
    [ ((each)) ] dip compose ; inline


: (3each) ( seq1 seq2 seq3 quot -- n quot' )
    [
        [ [ length ] tri@ min min check-length ]
        [ [ 3nth-unsafe ] 3curry ] 3bi
    ] dip compose ; inline

