USING: accessors arrays combinators combinators.short-circuit\r
-kernel locals make math math.order sequences sequences.private ;\r
+kernel locals make math math.order sequences sequences.private\r
+typed ;\r
IN: lcs\r
\r
<PRIVATE\r
: lcs-step ( insert delete change same? -- next )\r
1 -1/0. ? + max max ; ! -1/0. is -inf (float)\r
\r
-:: loop-step ( i j matrix old new step -- )\r
+TYPED:: loop-step ( i j matrix: array old new step -- )\r
i j 1 + matrix nth-unsafe nth-unsafe ! insertion\r
i 1 + j matrix nth-unsafe nth-unsafe ! deletion\r
i j matrix nth-unsafe nth-unsafe ! replace/retain\r