1 USING: locals sequences kernel math ;
5 :: insert ( seq quot: ( elt -- elt' ) n -- )
7 n n 1- [ seq nth quot call ] bi@ >= [
11 ] unless ; inline recursive
14 : insertion-sort ( seq quot -- )
15 ! quot is a transformation on elements
16 over length [ insert ] with with each ; inline