USING: io.pathnames kernel math math.parser sequences ; : path-without-extension ( path -- path ) [ [ 46 = ] find-last drop ] keep swap head ; : bump-ext ( path -- path ) dup file-extension string>number [ [ path-without-extension "." ] dip 1 + number>string 3append ] [ ".1" append ] if* ;