: basis-vector ( row col# -- ) [ clone ] dip [ swap nth neg recip ] 2keep [ 0 spin set-nth ] 2keep [ n*v ] dip matrix get set-nth ; : basis-vector ( col# row -- ) clone { [ nth neg recip ] [ [ 0 ] 2dip set-nth ] [ n*v ] } 2cleave matrix get set-nth ;