infix-subseq-step ( subseq step -- subseq' )


Vocabulary
infix.private

Inputs
subseqan object
stepan object


Outputs
subseq'an object


Definition


: infix-subseq-step ( subseq step -- subseq' )
{
{ 0 [ "slice step cannot be zero" throw ] }
{ 1 [ ] }
{ -1 [ reverse! ] }
[
[ dup length 1 [-] 0 ] dip
[ 0 > [ swap ] when ] keep <range> swap nths
]
} case ;